Skip to content

BoundContext

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

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:51

The child contexts

FSContext.children


readonly credentials: Credentials

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

The credentials of the context, used for access checks

FSContext.credentials


readonly descriptors: Map<number, Handle>

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

A map of open file descriptors to their handles

FSContext.descriptors


fs: __module & object & object

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

access: (this, …args) => void

FSContext

…[PathLike, number, Callback]

void

accessSync: (this, …args) => void

FSContext

…[PathLike, number]

void

appendFile: (this, …args) => void

FSContext

…[PathLike, FileContents, BufferEncoding, Callback]

void

appendFileSync: (this, …args) => void

FSContext

…[PathOrFileDescriptor, FileContents, WriteFileOptions]

void

BigIntStatsFs: typeof BigIntStatsFs

chmod: (this, …args) => void

FSContext

…[PathLike, string | number, Callback]

void

chmodSync: (this, …args) => void

FSContext

…[PathLike, Mode]

void

chown: (this, …args) => void

FSContext

…[PathLike, number, number, Callback]

void

chownSync: (this, …args) => void

FSContext

…[PathLike, number, number]

void

close: (this, …args) => void

FSContext

…[number, Callback]

void

closeSync: (this, …args) => void

FSContext

…[number]

void

constants: constants

copyFile: (this, …args) => void

FSContext

…[PathLike, PathLike, number, Callback]

void

copyFileSync: (this, …args) => void

FSContext

…[PathLike, PathLike, number]

void

cp: (this, …args) => void

FSContext

…[PathLike, PathLike, CopyOptions, Callback]

void

cpSync: (this, …args) => void

FSContext

…[PathLike, PathLike, CopySyncOptions]

void

createReadStream: (this, …args) => ReadStream

FSContext

…[PathLike, BufferEncoding | ReadStreamOptions]

ReadStream

createWriteStream: (this, …args) => WriteStream

FSContext

…[PathLike, BufferEncoding | WriteStreamOptions]

WriteStream

Dir: typeof Dir

Dirent: typeof Dirent

exists: (this, …args) => void

FSContext

…[PathLike, (exists) => unknown]

void

existsSync: (this, …args) => boolean

FSContext

…[PathLike]

boolean

fchmod: (this, …args) => void

FSContext

…[number, string | number, Callback]

void

fchmodSync: (this, …args) => void

FSContext

…[number, string | number]

void

fchown: (this, …args) => void

FSContext

…[number, number, number, Callback]

void

fchownSync: (this, …args) => void

FSContext

…[number, number, number]

void

fdatasync: (this, …args) => void

FSContext

…[number, Callback]

void

fdatasyncSync: (this, …args) => void

FSContext

…[number]

void

fstat: (this, …args) => void

FSContext

…[number, StatOptions & object, Callback<[BigIntStats]>]

void

fstatSync: (this, …args) => BigIntStats

FSContext

…[number, object]

BigIntStats

fsync: (this, …args) => void

FSContext

…[number, Callback]

void

fsyncSync: (this, …args) => void

FSContext

…[number]

void

ftruncate: (this, …args) => void

FSContext

…[number, number, Callback]

void

ftruncateSync: (this, …args) => void

FSContext

…[number, number | null]

void

futimes: (this, …args) => void

FSContext

…[number, number | Date, number | Date, Callback]

void

futimesSync: (this, …args) => void

FSContext

…[number, TimeLike, TimeLike]

void

glob: (this, …args) => void

FSContext

…[string | readonly string[], GlobOptions<string | Dirent<string>>, GlobCallback<[string[] | Dirent<string>[]]>]

void

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

FSContext

…[string | readonly string[], GlobOptions<string | Dirent<string>>]

string[] | Dirent<string>[]

lchmod: (this, …args) => void

FSContext

…[PathLike, string | number, Callback]

void

lchmodSync: (this, …args) => void

FSContext

…[PathLike, string | number]

void

lchown: (this, …args) => void

FSContext

…[PathLike, number, number, Callback]

void

lchownSync: (this, …args) => void

FSContext

…[PathLike, number, number]

void

link: (this, …args) => void

FSContext

…[PathLike, PathLike, Callback]

void

linkSync: (this, …args) => void

FSContext

…[PathLike, PathLike]

void

lopenSync: (this, …args) => number

FSContext

…[PathLike, string, Mode | null]

number

lstat: (this, …args) => void

FSContext

…[PathLike, StatOptions, Callback<[BigIntStats | Stats]>]

void

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

FSContext

…[PathLike, StatOptions]

BigIntStats | Stats | undefined

lutimes: (this, …args) => void

FSContext

…[PathLike, number | Date, number | Date, Callback]

void

lutimesSync: (this, …args) => void

FSContext

…[PathLike, TimeLike, TimeLike]

void

mkdir: (this, …args) => void

FSContext

…[PathLike, Mode, Callback]

void

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

FSContext

…[PathLike, Mode | MakeDirectoryOptions | null]

string | undefined

mkdtemp: (this, …args) => void

FSContext

…[string, BufferEncodingOption, Callback<[Buffer<ArrayBufferLike>]>]

void

mkdtempDisposableSync: (this, …args) => object

FSContext

…[PathLike, BufferEncodingOption | EncodingOption]

object

path: string

[dispose](): void

void

remove(): void

void

mkdtempSync: (this, …args) => string

FSContext

…[PathLike, EncodingOption]

string

open: (this, …args) => void

FSContext

…[PathLike, OpenMode, string | number, Callback<[number]>]

void

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

FSContext

…[PathLike, OpenAsBlobOptions]

Promise<Blob>

opendir: (this, …args) => void

FSContext

…[PathLike, OpenDirOptions, Callback<[Dir]>]

void

opendirSync: (this, …args) => Dir

FSContext

…[PathLike, OpenDirOptions]

Dir

openSync: (this, …args) => number

FSContext

…[PathLike, OpenMode, Mode | null]

number

promises: promises

read: (this, …args) => void

FSContext

…[number, Uint8Array<ArrayBufferLike>, number, number, number, Callback<[number, Uint8Array<ArrayBufferLike>]>]

void

readdir: (this, …args) => void

FSContext

…[PathLike, object, Callback<[Dirent<string>[]]>]

void

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

FSContext

…[PathLike, NodeReaddirOptions]

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

readFile: (this, …args) => void

FSContext

…[PathLike, BufferEncoding | { encoding: BufferEncoding; flag?: string; }, Callback<[string]>]

void

readFileSync: (this, …args) => string

FSContext

…[PathOrFileDescriptor, BufferEncoding | EncodingOption & { flag?: string | undefined; } | null]

string

readlink: (this, …args) => void

FSContext

…[PathLike, EncodingOption, Callback<[string]>]

void

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

FSContext

…[PathLike, "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

…[number, ArrayBufferView<ArrayBufferLike>, number, number, ReadPosition | null]

number

readv: (this, …args) => void

FSContext

…[number, ArrayBufferView<ArrayBufferLike>[], number, readvCb]

void

readvSync: (this, …args) => number

FSContext

…[number, readonly ArrayBufferView<ArrayBufferLike>[], number]

number

realpath: (this, …args) => void

FSContext

…[PathLike, EncodingOption, Callback<[string]>]

void

realpathSync: (this, …args) => string

FSContext

…[PathLike, EncodingOption]

string

rename: (this, …args) => void

FSContext

…[PathLike, PathLike, Callback]

void

renameSync: (this, …args) => void

FSContext

…[PathLike, PathLike]

void

rm: (this, …args) => void

FSContext

…[PathLike, RmOptions, Callback]

void

rmdir: (this, …args) => void

FSContext

…[PathLike, Callback]

void

rmdirSync: (this, …args) => void

FSContext

…[PathLike]

void

rmSync: (this, …args) => void

FSContext

…[PathLike, RmOptions]

void

stat: (this, …args) => void

FSContext

…[PathLike, StatOptions, Callback<[BigIntStats | Stats | undefined]>]

void

statfs: (this, …args) => void

FSContext

…[PathLike, StatFsOptions & object, Callback<[BigIntStatsFs]>]

void

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

FSContext

…[PathLike, StatFsOptions]

StatsFs | BigIntStatsFs

Stats: typeof Stats

StatsFs: typeof StatsFs

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

FSContext

…[PathLike, StatOptions]

BigIntStats | Stats | undefined

symlink: (this, …args) => void

FSContext

…[PathLike, PathLike, Type, Callback]

void

symlinkSync: (this, …args) => void

FSContext

…[PathLike, PathLike, Type | null]

void

truncate: (this, …args) => void

FSContext

…[PathLike, number, Callback]

void

truncateSync: (this, …args) => void

FSContext

…[PathLike, number | null]

void

unlink: (this, …args) => void

FSContext

…[PathLike, Callback]

void

unlinkSync: (this, …args) => void

FSContext

…[PathLike]

void

unwatchFile: (this, …args) => void

FSContext

…[PathLike, (curr, prev) => void]

void

Utf8Stream: typeof Utf8Stream

utimes: (this, …args) => void

FSContext

…[PathLike, number | Date, number | Date, Callback]

void

utimesSync: (this, …args) => void

FSContext

…[PathLike, TimeLike, TimeLike]

void

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

FSContext

…[PathLike, object, (event, filename) => any]

FSWatcher<string | Buffer<ArrayBufferLike>>

watchFile: (this, …args) => void

FSContext

…[PathLike, object, (curr, prev) => void]

void

write: (this, …args) => void

FSContext

…[number, FileContents, number | null, BufferEncoding, Callback<[number, string]>]

void

writeFile: (this, …args) => void

FSContext

…[PathLike, FileContents, WriteFileOptions, Callback]

void

writeFileSync: (this, …args) => void

FSContext

…[PathOrFileDescriptor, FileContents, BufferEncoding]

void

WriteStream: typeof WriteStream

writeSync: (this, …args) => number

FSContext

…[number, string, number | null, BufferEncoding | null]

number

writev: (this, …args) => void

FSContext

…[number, Uint8Array<ArrayBufferLike>[], number, writevCb]

void

writevSync: (this, …args) => number

FSContext

…[number, readonly ArrayBufferView<ArrayBufferLike>[], 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:54

The mount table for this context

FSContext.mounts


parent: FSContext

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

The parent context, if any.

FSContext.parent


path: Bound<__module, FSContext>

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

Path functions, bound to the context


pwd: string

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

The current working directory of the context

FSContext.pwd


root: string

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

The absolute root path of the context

Note the parent’s root is not considered

FSContext.root

bind(init): BoundContext

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

Creates a new child context with this context as the parent

ContextInit

BoundContext