Path.rmdir() method
pathlib-ts > Path > rmdir
Path.rmdir() method
Section titled “Path.rmdir() method”Remove this directory; the directory must already be empty.
Signature:
rmdir(): Promise<void>;Returns:
Promise<void>
Promise that settles once the directory is removed.
Remarks
Section titled “Remarks”Uses Node’s fs.rmdir to mirror CPython semantics.
Example
Section titled “Example”Removing staging directories asynchronously
import { Path } from "pathlib-ts";
const staging = new Path("./build/staging");await staging.rmdir();