Skip to main content

removeSync

function Deno.removeSync
allow-write
Jump to headingremoveSync(
path: string | URL,
options?: RemoveOptions,
): void

Synchronously removes the named file or directory.

Deno.removeSync("/path/to/empty_dir/or/file");
Deno.removeSync("/path/to/populated_dir/or/file", { recursive: true });

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.

Parameters Jump to heading

Jump to headingpath: string | URL

Return Type Jump to heading

void
Back to top