Interface DirHandle

Directory entries can be obtained through asynchronous iteration:

const dirIter = await tjs.readDir('.');
for await (const item of dirIter) {
console.log(item.name);
}
interface DirHandle {
    path: string;
    [asyncIterator](): AsyncIterableIterator<DirEnt>;
    close(): Promise<void>;
    next(...args: [] | [undefined]): Promise<IteratorResult<DirEnt, any>>;
    return?(value?: any): Promise<IteratorResult<DirEnt, any>>;
    throw?(e?: any): Promise<IteratorResult<DirEnt, any>>;
}

Hierarchy

  • AsyncIterableIterator<DirEnt>
    • DirHandle

Properties

path: string

Path of the directory.

Methods

  • Returns AsyncIterableIterator<DirEnt>

  • Closes the directory handle.

    Returns Promise<void>

  • Parameters

    • Rest...args: [] | [undefined]

    Returns Promise<IteratorResult<DirEnt, any>>

  • Parameters

    • Optionalvalue: any

    Returns Promise<IteratorResult<DirEnt, any>>

  • Parameters

    • Optionale: any

    Returns Promise<IteratorResult<DirEnt, any>>