Skip to content

Dir

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

A class representing a directory stream.

new Dir(path, context): Dir

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

string

unknown

Dir

protected optional _entries?: Dirent<string>[]

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


protected closed: boolean = false

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


protected readonly context: unknown

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


readonly path: string

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

_Dir.path

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

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

Promise<Dirent<string> | null>


[asyncDispose](): Promise<void>

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

Promise<void>

_Dir.[asyncDispose]


[asyncIterator](): this

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

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

void

_Dir.[dispose]


protected checkClosed(): void

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

void


close(): Promise<void>

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

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

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

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

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

AsyncIterator.next


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

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

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

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

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