Skip to main content
Dir.prototype.read - node__fs.d.ts - Node documentation
method Dir.prototype.read

Usage in Deno

```typescript import { Dir } from "node:node__fs.d.ts"; ```
Dir.prototype.read(): Promise<Dirent | null>
Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. A promise is returned that will be fulfilled with an `fs.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. Entries added or removed while iterating over the directory might not be included in the iteration results.

Return Type

Promise<Dirent | null>
containing {fs.Dirent|null}
Dir.prototype.read(cb: (
err: ErrnoException | null,
dirEnt: Dirent | null,
) => void
): void

Parameters

cb: (
err: ErrnoException | null,
dirEnt: Dirent | null,
) => void

Return Type

void