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

Usage in Deno

```typescript import { rmdirSync } from "node:node__fs.d.ts"; ```
rmdirSync(
path: PathLike,
options?: RmDirOptions,
): void
Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. Using `fs.rmdirSync()` 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 [rmSync](../.././node__fs.d.ts/~/rmSync) with options `{ recursive: true, force: true }`.

Parameters

path: PathLike
optional
options: RmDirOptions

Return Type

void