Skip to main content

remove

function Deno.remove
allow-write
Jump to headingremove(
path: string | URL,
options?: RemoveOptions,
): Promise<void>

Removes the named file or directory.

await Deno.remove("/path/to/empty_dir/or/file");
await Deno.remove("/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

Promise<void>
Back to top