deno / 1.23.2 / ~ / deno.removesync.html /

Deno.removeSync

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.

function removeSync( path: string | URL , options?: RemoveOptions) : void;
removeSync( path: string | URL , options?: RemoveOptions) : void

Parameters

path: string | URL
options?: RemoveOptions optional

Return Type

void

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/Deno.removeSync