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

Usage in Deno

```typescript import { rmdir } from "node:node__fs.d.ts"; ```
rmdir(
path: PathLike,
callback: NoParamCallback,
): void
Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given to the completion callback. Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. To get a behavior similar to the `rm -rf` Unix command, use [rm](../.././node__fs.d.ts/~/rm) with options `{ recursive: true, force: true }`.

Parameters

path: PathLike
callback: NoParamCallback

Return Type

void
rmdir(
path: PathLike,
options: RmDirOptions,
callback: NoParamCallback,
): void

Parameters

path: PathLike
options: RmDirOptions
callback: NoParamCallback

Return Type

void