removeSync
import { removeSync } from "jsr:@ende/fs/unstable-remove";function · experimental · requires --allow-write
function removeSync(path: string | URL, options?: RemoveOptions): voidSynchronously removes the named file or directory.
Throws error if permission denied, path not found, or path is a non-empty directory and the recursive option isn't set to true.
Requires allow-write permission.
path: string | URLThe path of file or directory.
options?: RemoveOptionsOptions when reading a file. See
RemoveOptions.
Example: Usage
import { assertFalse } from "@ende/assert";
import { existsSync } from "@ende/fs/exists";
import { removeSync } from "@ende/fs/unstable-remove";
import { makeTempDirSync } from "@ende/fs/unstable-make-temp-dir";
const tempDir = makeTempDirSync();
removeSync(tempDir);
assertFalse(existsSync(tempDir));