W3cubDocs

/Deno

Deno.remove

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.

function remove(path: string | URL, options?: RemoveOptions): Promise<void>;
remove(path: string | URL, options?: RemoveOptions): Promise<void>

Parameters

path: string | URL
options?: RemoveOptions optional

Return Type

Promise<void>

© 2018–2021 the Deno authors
https://doc.deno.land/deno/stable/~/Deno.remove