class
vfs.VirtualFileSystem
class VirtualFileSystem
A VirtualFileSystem wraps a VirtualProvider and exposes a node:fs-like API. Each instance maintains its own file tree.
- appendFileSync: (path: PathOrFileDescriptor, data: string | Uint8Array<ArrayBufferLike>, options?: WriteFileOptions) => void
- fstatSync: {(fd: number, options?: StatOptions & { bigint: false }) => Stats; (fd: number, options: StatOptions & { bigint: true }) => BigIntStats; (fd: number, options?: StatOptions) => Stats | BigIntStats}
- lstatSync: {(path: PathLike) => Stats; (path: PathLike, options?: StatOptions & { bigint: false; throwIfNoEntry: true }) => Stats; (path: PathLike, options: StatOptions & { bigint: true; throwIfNoEntry: true }) => BigIntStats; (path: PathLike, options: StatOptions & { bigint: false; throwIfNoEntry: false }) => undefined | Stats; (path: PathLike, options: StatOptions & { bigint: true; throwIfNoEntry: false }) => undefined | BigIntStats; (path: PathLike, options: StatOptions & { throwIfNoEntry: true }) => Stats | BigIntStats; (path: PathLike, options?: StatOptions) => undefined | Stats | BigIntStats}
- mkdirSync: {(path: PathLike, options: MakeDirectoryOptions & { recursive: true }) => undefined | string; (path: PathLike, options?: null | Mode | MakeDirectoryOptions & { recursive: false }) => void; (path: PathLike, options?: null | Mode | MakeDirectoryOptions) => undefined | string}
- mkdtempSync: {(prefix: string, options?: EncodingOption) => string; (prefix: string, options: BufferEncodingOption) => NonSharedBuffer; (prefix: string, options?: EncodingOption) => string | NonSharedBuffer}
- readonly promises: Pick<__module, 'open' | 'rename' | 'watch' | 'readFile' | 'writeFile' | 'stat' | 'lstat' | 'readdir' | 'realpath' | 'readlink' | 'access' | 'rm' | 'truncate' | 'link' | 'mkdtemp' | 'appendFile' | 'mkdir' | 'rmdir' | 'unlink' | 'copyFile' | 'symlink' | 'chmod' | 'chown' | 'lchown' | 'utimes' | 'lutimes' | 'lchmod'>
- readdirSync: {(path: PathLike, options?: null | BufferEncoding | { encoding: unknown; recursive: boolean; withFileTypes: false }) => string[]; (path: PathLike, options: 'buffer' | { encoding: 'buffer'; recursive: boolean; withFileTypes: false }) => NonSharedBuffer[]; (path: PathLike, options?: null | BufferEncoding | ObjectEncodingOptions & { recursive: boolean; withFileTypes: false }) => string[] | NonSharedBuffer[]; (path: PathLike, options: ObjectEncodingOptions & { recursive: boolean; withFileTypes: true }) => Dirent<string>[]; (path: PathLike, options: { encoding: 'buffer'; recursive: boolean; withFileTypes: true }) => Dirent<NonSharedBuffer>[]}
- readFileSync: {(path: PathOrFileDescriptor, options: ReadFileSyncOptionsWithBuffer<T>) => BufferView<T>; (path: PathOrFileDescriptor, options?: null | ReadFileSyncOptionsWithBufferEncoding) => NonSharedBuffer; (path: PathOrFileDescriptor, options: BufferEncoding | ReadFileSyncOptionsWithStringEncoding) => string; (path: PathOrFileDescriptor, options: ReadFileSyncOptions) => string | NonSharedBuffer}
- readlinkSync: {(path: PathLike, options?: EncodingOption) => string; (path: PathLike, options: BufferEncodingOption) => NonSharedBuffer; (path: PathLike, options?: EncodingOption) => string | NonSharedBuffer}
- readSync: {(fd: number, buffer: ArrayBufferView, offset: number, length: number, position?: null | ReadPosition) => number; (fd: number, buffer: ArrayBufferView, opts?: ReadOptions) => number}
- statSync: {(path: PathLike) => Stats; (path: PathLike, options?: StatOptions & { bigint: false; throwIfNoEntry: true }) => Stats; (path: PathLike, options: StatOptions & { bigint: true; throwIfNoEntry: true }) => BigIntStats; (path: PathLike, options: StatOptions & { bigint: false; throwIfNoEntry: false }) => undefined | Stats; (path: PathLike, options: StatOptions & { bigint: true; throwIfNoEntry: false }) => undefined | BigIntStats; (path: PathLike, options: StatOptions & { throwIfNoEntry: true }) => Stats | BigIntStats; (path: PathLike, options?: StatOptions) => undefined | Stats | BigIntStats}
- unwatchFile: {(filename: PathLike, listener?: StatsListener) => void; (filename: PathLike, listener?: BigIntStatsListener) => void}
- watch: {(filename: PathLike, options?: null | BufferEncoding | WatchOptionsWithStringEncoding, listener?: WatchListener<string>) => FSWatcher; (filename: PathLike, options: 'buffer' | WatchOptionsWithBufferEncoding, listener: WatchListener<NonSharedBuffer>) => FSWatcher; (filename: PathLike, options: null | BufferEncoding | 'buffer' | WatchOptions, listener: WatchListener<string | NonSharedBuffer>) => FSWatcher; (filename: PathLike, listener: WatchListener<string>) => FSWatcher}
- watchFile: {(filename: PathLike, options: undefined | WatchFileOptions & { bigint: false }, listener: StatsListener) => StatWatcher; (filename: PathLike, options: undefined | WatchFileOptions & { bigint: true }, listener: BigIntStatsListener) => StatWatcher; (filename: PathLike, listener: StatsListener) => StatWatcher}
- writeFileSync: (file: PathOrFileDescriptor, data: string | ArrayBufferView<ArrayBufferLike>, options?: WriteFileOptions) => void
- writeSync: {(fd: number, buffer: ArrayBufferView, offset?: null | number, length?: null | number, position?: null | number) => number; (fd: number, string: string, position?: null | number, encoding?: null | BufferEncoding) => number}