Skip to content

Dir

Defined in: src/node/dir.ts:88

A class representing a directory stream.

new Dir(path, context, options?): Dir

Defined in: src/node/dir.ts:97

string

unknown

OpenDirOptions = {}

Dir

protected optional _entries?: Dirent<string>[]

Defined in: src/node/dir.ts:95


protected closed: boolean = false

Defined in: src/node/dir.ts:89


protected readonly context: unknown

Defined in: src/node/dir.ts:99


protected readonly options: OpenDirOptions = {}

Defined in: src/node/dir.ts:100


readonly path: string

Defined in: src/node/dir.ts:98

_Dir.path

protected _read(): Promise<Dirent<string> | null>

Defined in: src/node/dir.ts:125

Promise<Dirent<string> | null>


[asyncDispose](): Promise<void>

Defined in: src/node/dir.ts:193

Promise<void>

_Dir.[asyncDispose]


[asyncIterator](): this

Defined in: src/node/dir.ts:184

Asynchronously iterates over the directory via readdir(3) until all entries have been read.

this

_Dir.[asyncIterator]


[dispose](): void

Defined in: src/node/dir.ts:188

void

_Dir.[dispose]


protected checkClosed(): void

Defined in: src/node/dir.ts:91

void


close(): Promise<void>

Defined in: src/node/dir.ts:107

Asynchronously close the directory’s underlying resource handle. Subsequent reads will result in errors.

Promise<void>

_Dir.close

close(cb): void

Defined in: src/node/dir.ts:108

Asynchronously close the directory’s underlying resource handle. Subsequent reads will result in errors.

Callback

void

_Dir.close


closeSync(): void

Defined in: src/node/dir.ts:120

Synchronously close the directory’s underlying resource handle. Subsequent reads will result in errors.

void

_Dir.closeSync


next(): Promise<IteratorResult<Dirent<string>, any>>

Defined in: src/node/dir.ts:171

Promise<IteratorResult<Dirent<string>, any>>

AsyncIterator.next


read(): Promise<Dirent<string> | null>

Defined in: src/node/dir.ts:141

Asynchronously read the next directory entry via readdir(3) as an Dirent. After the read is completed, a value is returned that will be resolved with an Dirent, or null if there are no more directory entries to read. Directory entries returned by this function are in no particular order as provided by the operating system’s underlying directory mechanisms.

Promise<Dirent<string> | null>

_Dir.read

read(cb): void

Defined in: src/node/dir.ts:142

Asynchronously read the next directory entry via readdir(3) as an Dirent. After the read is completed, a value is returned that will be resolved with an Dirent, or null if there are no more directory entries to read. Directory entries returned by this function are in no particular order as provided by the operating system’s underlying directory mechanisms.

Callback<[Dirent<string> | null]>

void

_Dir.read


readSync(): Dirent<string> | null

Defined in: src/node/dir.ts:160

Synchronously read the next directory entry via readdir(3) as a Dirent. If there are no more directory entries to read, null will be returned. Directory entries returned by this function are in no particular order as provided by the operating system’s underlying directory mechanisms.

Dirent<string> | null

_Dir.readSync