Skip to main content
opendir - node__fs.d.ts - Node documentation
function opendir

Usage in Deno

```typescript import { opendir } from "node:node__fs.d.ts"; ```
opendir(
path: PathLike,
cb: (
err: ErrnoException | null,
dir: Dir,
) => void
,
): void
Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more details. Creates an `fs.Dir`, which contains all further functions for reading from and cleaning up the directory. The `encoding` option sets the encoding for the `path` while opening the directory and subsequent read operations.

Parameters

path: PathLike
cb: (
err: ErrnoException | null,
dir: Dir,
) => void

Return Type

void
opendir(
path: PathLike,
options: OpenDirOptions,
cb: (
err: ErrnoException | null,
dir: Dir,
) => void
,
): void

Parameters

path: PathLike
options: OpenDirOptions
cb: (
err: ErrnoException | null,
dir: Dir,
) => void

Return Type

void