Skip to content

BoundContext

Defined in: src/internal/contexts.ts:76

Allows you to restrict operations to a specific root path and set of credentials.

readonly [kIsContext]: boolean

Defined in: src/internal/contexts.ts:26

Brand

FSContext.[kIsContext]


readonly children: FSContext[]

Defined in: src/internal/contexts.ts:53

The child contexts

FSContext.children


readonly credentials: Credentials

Defined in: src/internal/contexts.ts:41

The credentials of the context, used for access checks

FSContext.credentials


readonly descriptors: Map<number, Handle>

Defined in: src/internal/contexts.ts:47

A map of open file descriptors to their handles

FSContext.descriptors


fs: __module & object & object

Defined in: src/internal/contexts.ts:77

access: (this, …args) => void

FSContext

…[path: PathLike, mode: number, cb: Callback]

void

accessSync: (this, …args) => void

FSContext

…[path: PathLike, mode: number]

void

appendFile: (this, …args) => void

FSContext

…[filename: PathOrFileDescriptor, data: FileContents, encoding?: BufferEncoding, cb?: Callback]

void

appendFileSync: (this, …args) => void

FSContext

…[filename: PathOrFileDescriptor, data: FileContents, _options: WriteFileOptions]

void

BigIntStatsFs: typeof BigIntStatsFs

chmod: (this, …args) => void

FSContext

…[path: PathLike, mode: string | number, cb: Callback]

void

chmodSync: (this, …args) => void

FSContext

…[path: PathLike, mode: Mode]

void

chown: (this, …args) => void

FSContext

…[path: PathLike, uid: number, gid: number, cb: Callback]

void

chownSync: (this, …args) => void

FSContext

…[path: PathLike, uid: number, gid: number]

void

close: (this, …args) => void

FSContext

…[fd: number, cb: Callback]

void

closeSync: (this, …args) => void

FSContext

…[fd: number]

void

constants: constants

copyFile: (this, …args) => void

FSContext

…[src: PathLike, dest: PathLike, flags: number, callback: Callback]

void

copyFileSync: (this, …args) => void

FSContext

…[source: PathLike, destination: PathLike, flags?: number]

void

cp: (this, …args) => void

FSContext

…[source: PathLike, destination: PathLike, opts: CopyOptions, callback: Callback]

void

cpSync: (this, …args) => void

FSContext

…[source: PathLike, destination: PathLike, opts?: CopySyncOptions]

void

createReadStream: (this, …args) => ReadStream

FSContext

…[path: PathLike, options?: BufferEncoding | ReadStreamOptions]

ReadStream

createWriteStream: (this, …args) => WriteStream

FSContext

…[path: PathLike, options?: BufferEncoding | WriteStreamOptions]

WriteStream

Dir: typeof Dir

Dirent: typeof Dirent

exists: (this, …args) => void

FSContext

…[path: PathLike, cb: (exists) => unknown]

void

existsSync: (this, …args) => boolean

FSContext

…[path: PathLike]

boolean

fchmod: (this, …args) => void

FSContext

…[fd: number, mode: string | number, cb: Callback]

void

fchmodSync: (this, …args) => void

FSContext

…[fd: number, mode: string | number]

void

fchown: (this, …args) => void

FSContext

…[fd: number, uid: number, gid: number, cb: Callback]

void

fchownSync: (this, …args) => void

FSContext

…[fd: number, uid: number, gid: number]

void

fdatasync: (this, …args) => void

FSContext

…[fd: number, cb: Callback]

void

fdatasyncSync: (this, …args) => void

FSContext

…[fd: number]

void

fstat: (this, …args) => void

FSContext

…[fd: number, options: StatOptions & object, cb: Callback<[BigIntStats]>]

void

fstatSync: (this, …args) => BigIntStats

FSContext

…[fd: number, options: object]

BigIntStats

fsync: (this, …args) => void

FSContext

…[fd: number, cb: Callback]

void

fsyncSync: (this, …args) => void

FSContext

…[fd: number]

void

ftruncate: (this, …args) => void

FSContext

…[fd: number, len?: number, cb?: Callback]

void

ftruncateSync: (this, …args) => void

FSContext

…[fd: number, len: number | null]

void

futimes: (this, …args) => void

FSContext

…[fd: number, atime: number | Date, mtime: number | Date, cb: Callback]

void

futimesSync: (this, …args) => void

FSContext

…[fd: number, atime: TimeLike, mtime: TimeLike]

void

glob: (this, …args) => void

FSContext

…[pattern: string | readonly string[], options: GlobOptions<string | Dirent<string>>, callback: GlobCallback<[string[] | Dirent<string>[]]>]

void

globSync: (this, …args) => string[] | Dirent<string>[]

FSContext

…[pattern: string | readonly string[], options: GlobOptions<string | Dirent<string>>]

string[] | Dirent<string>[]

lchmod: (this, …args) => void

FSContext

…[path: PathLike, mode: string | number, cb: Callback]

void

lchmodSync: (this, …args) => void

FSContext

…[path: PathLike, mode: string | number]

void

lchown: (this, …args) => void

FSContext

…[path: PathLike, uid: number, gid: number, cb: Callback]

void

lchownSync: (this, …args) => void

FSContext

…[path: PathLike, uid: number, gid: number]

void

link: (this, …args) => void

FSContext

…[existing: PathLike, newpath: PathLike, cb: Callback]

void

linkSync: (this, …args) => void

FSContext

…[targetPath: PathLike, linkPath: PathLike]

void

lopenSync: (this, …args) => number

FSContext

…[path: PathLike, flag: string, mode?: Mode | null]

number

lstat: (this, …args) => void

FSContext

…[path: PathLike, options: StatOptions, callback: Callback<[BigIntStats | Stats]>]

void

lstatSync: (this, …args) => BigIntStats | Stats | undefined

FSContext

…[path: PathLike, options?: StatOptions]

BigIntStats | Stats | undefined

lutimes: (this, …args) => void

FSContext

…[path: PathLike, atime: number | Date, mtime: number | Date, cb: Callback]

void

lutimesSync: (this, …args) => void

FSContext

…[path: PathLike, atime: TimeLike, mtime: TimeLike]

void

mkdir: (this, …args) => void

FSContext

…[path: PathLike, mode?: Mode, cb: Callback]

void

mkdirSync: (this, …args) => string | undefined

FSContext

…[path: PathLike, options?: Mode | MakeDirectoryOptions | null]

string | undefined

mkdtemp: (this, …args) => void

FSContext

…[prefix: PathLike, options: BufferEncodingOption, callback: Callback<[Buffer<ArrayBufferLike>]>]

void

mkdtempDisposableSync: (this, …args) => DisposableTempDir

FSContext

…[prefix: PathLike, options?: BufferEncodingOption | EncodingOption]

DisposableTempDir

mkdtempSync: (this, …args) => string | NonSharedBuffer

FSContext

…[prefix: PathLike, options?: BufferEncodingOption | EncodingOption]

string | NonSharedBuffer

mkstemp: (this, …args) => void

FSContext

…[prefix: PathLike, options: BufferEncodingOption | EncodingOption, callback: TempFileCallback<string | NonSharedBuffer>]

void

mkstempSync: (this, …args) => TempFile<string | NonSharedBuffer>

FSContext

…[prefix: PathLike, options?: BufferEncodingOption | EncodingOption]

TempFile<string | NonSharedBuffer>

open: (this, …args) => void

FSContext

…[path: PathLike, flag: OpenMode, mode: Mode | null, cb?: Callback<[number]>]

void

openAsBlob: (this, …args) => Promise<Blob>

FSContext

…[path: PathLike, options: OpenAsBlobOptions]

Promise<Blob>

openAsBlobSync: (this, …args) => Blob

FSContext

…[path: PathLike, options: OpenAsBlobOptions]

Blob

opendir: (this, …args) => void

FSContext

…[path: PathLike, options: OpenDirOptions, cb: Callback<[Dir]>]

void

opendirSync: (this, …args) => Dir

FSContext

…[path: PathLike, options?: OpenDirOptions]

Dir

openSync: (this, …args) => number

FSContext

…[path: PathLike, flag?: OpenMode | null, mode: Mode | null]

number

OperationsHandle: typeof OperationsHandle

promises: promises

read: (this, …args) => void

FSContext

…[fd: number, buffer: ArrayBufferView<ArrayBufferLike>, offset: number, length: number, position?: ReadPosition | null, cb?: Callback<[number, ArrayBufferView<ArrayBufferLike>]>]

void

readdir: (this, …args) => void

FSContext

…[path: PathLike, options: object, cb: Callback<[Dirent<string>[]]>]

void

readdirSync: (this, …args) => string[] | Dirent<any>[] | Buffer<ArrayBufferLike>[]

FSContext

…[path: PathLike, options?: NodeReaddirOptions]

string[] | Dirent<any>[] | Buffer<ArrayBufferLike>[]

readFile: (this, …args) => void

FSContext

…[filename: PathOrFileDescriptor, options: BufferEncoding | object & Abortable, cb: Callback<[string]>]

void

readFileSync: (this, …args) => string | NonSharedBuffer

FSContext

…[path: PathOrFileDescriptor, options: ReadFileSyncOptions]

string | NonSharedBuffer

readlink: (this, …args) => void

FSContext

…[path: PathLike, options: EncodingOption, callback: Callback<[string]>]

void

readlinkSync: (this, …args) => string | NonSharedBuffer

FSContext

…[path: PathLike, options?: "buffer" | { encoding: "buffer"; } | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | ObjectEncodingOptions | null]

string | NonSharedBuffer

ReadStream: typeof ReadStream

readSync: (this, …args) => number

FSContext

…[fd: number, buffer: ArrayBufferView<ArrayBufferLike>, offset: number, length: number, position?: ReadPosition | null]

number

readv: (this, …args) => void

FSContext

…[fd: number, buffers: ArrayBufferView<ArrayBufferLike>[], position: number, cb: readvCb]

void

readvSync: (this, …args) => number

FSContext

…[fd: number, buffers: readonly ArrayBufferView<ArrayBufferLike>[], position?: number]

number

realpath: (this, …args) => void

FSContext

…[path: PathLike, callback: RealpathCallback<string>]

void

realpathSync: (this, …args) => string | NonSharedBuffer

FSContext

…[path: PathLike, options?: EncodingOption]

string | NonSharedBuffer

rename: (this, …args) => void

FSContext

…[oldPath: PathLike, newPath: PathLike, cb: Callback]

void

renameSync: (this, …args) => void

FSContext

…[oldPath: PathLike, newPath: PathLike]

void

rm: (this, …args) => void

FSContext

…[path: PathLike, options: RmOptions, callback: Callback]

void

rmdir: (this, …args) => void

FSContext

…[path: PathLike, options: RmDirOptions, cb?: Callback]

void

rmdirSync: (this, …args) => void

FSContext

…[path: PathLike]

void

rmSync: (this, …args) => void

FSContext

…[path: PathLike, options?: RmOptions]

void

stat: (this, …args) => void

FSContext

…[path: PathLike, options: StatOptions, callback: Callback<[BigIntStats | Stats | undefined]>]

void

statfs: (this, …args) => void

FSContext

…[path: PathLike, options: StatFsOptions & object, callback: Callback<[BigIntStatsFs]>]

void

statfsSync: (this, …args) => StatsFs | BigIntStatsFs

FSContext

…[path: PathLike, options?: StatFsOptions]

StatsFs | BigIntStatsFs

Stats: typeof Stats

StatsFs: typeof StatsFs

statSync: (this, …args) => BigIntStats | Stats | undefined

FSContext

…[path: PathLike, options?: StatOptions]

BigIntStats | Stats | undefined

symlink: (this, …args) => void

FSContext

…[target: PathLike, path: PathLike, type?: Type, cb?: Callback]

void

symlinkSync: (this, …args) => void

FSContext

…[target: PathLike, path: PathLike, type: Type | null]

void

truncate: (this, …args) => void

FSContext

…[path: PathLike, len: number, cb?: Callback]

void

truncateSync: (this, …args) => void

FSContext

…[path: PathLike, len: number | null]

void

unlink: (this, …args) => void

FSContext

…[path: PathLike, cb: Callback]

void

unlinkSync: (this, …args) => void

FSContext

…[path: PathLike]

void

unwatchFile: (this, …args) => void

FSContext

…[path: PathLike, listener?: (curr, prev) => void]

void

Utf8Stream: typeof Utf8Stream

utimes: (this, …args) => void

FSContext

…[path: PathLike, atime: number | Date, mtime: number | Date, cb: Callback]

void

utimesSync: (this, …args) => void

FSContext

…[path: PathLike, atime: TimeLike, mtime: TimeLike]

void

validateOperations: (this, …args) => void

FSContext

…[operations: StreamOperations, kind: "write" | "read", options: object]

void

watch: (this, …args) => FSWatcher<string | Buffer<ArrayBufferLike>>

FSContext

…[path: PathLike, options: WatchOptions, listener?: (event, filename) => any]

FSWatcher<string | Buffer<ArrayBufferLike>>

watchFile: (this, …args) => StatWatcher

FSContext

…[path: PathLike, options: WatchFileOptions & object, listener: (curr, prev) => void]

StatWatcher

write: (this, …args) => void

FSContext

…[fd: number, data: FileContents, position: number | null, encoding: BufferEncoding, cb?: Callback<[number, string]>]

void

writeFile: (this, …args) => void

FSContext

…[filename: PathOrFileDescriptor, data: FileContents, options?: WriteFileOptions, cb?: Callback]

void

writeFileSync: (this, …args) => void

FSContext

…[path: PathOrFileDescriptor, data: FileContents, encoding?: BufferEncoding]

void

WriteStream: typeof WriteStream

writeSync: (this, …args) => number

FSContext

…[fd: number, data: string, position?: number | null, encoding?: BufferEncoding | null]

number

writev: (this, …args) => void

FSContext

…[fd: number, buffers: Uint8Array<ArrayBufferLike>[], position: number, cb: writevCb]

void

writevSync: (this, …args) => number

FSContext

…[fd: number, buffers: readonly ArrayBufferView<ArrayBufferLike>[], position?: number]

number

promises: Bound<promises, FSContext>

xattr: Bound<xattr, FSContext>


readonly id: number

Defined in: src/internal/contexts.ts:29

The unique ID of the context

FSContext.id


readonly mounts: Map<string, FileSystem>

Defined in: src/internal/contexts.ts:56

The mount table for this context

FSContext.mounts


parent: FSContext

Defined in: src/internal/contexts.ts:86

The parent context, if any.

FSContext.parent


path: Bound<__module, FSContext>

Defined in: src/internal/contexts.ts:80

Path functions, bound to the context


pwd: string

Defined in: src/internal/contexts.ts:38

The current working directory of the context

FSContext.pwd


root: string

Defined in: src/internal/contexts.ts:35

The absolute root path of the context. Note the parent’s root is not considered

FSContext.root


umask: number

Defined in: src/internal/contexts.ts:44

Permission bits cleared from the mode of newly created files and directories

FSContext.umask

bind(init): BoundContext

Defined in: src/internal/contexts.ts:83

Creates a new child context with this context as the parent

ContextInit

BoundContext