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

Usage in Deno

```typescript import { rmdir } from "node:node__fs--promises.d.ts"; ```
rmdir(
path: PathLike,
options?: RmDirOptions,
): Promise<void>
Removes the directory identified by `path`. Using `fsPromises.rmdir()` on a file (not a directory) results in the promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`.

Parameters

path: PathLike
optional
options: RmDirOptions

Return Type

Promise<void>
Fulfills with `undefined` upon success.