Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/xdg/vendor/types/deno.d.ts>Deno.removeSync

Determine XDG Base Directory paths (OS/platform portable)
Go to Latest
function Deno.removeSync
import { Deno } from "https://deno.land/x/xdg@v10.5.1/vendor/types/deno.d.ts";
const { removeSync } = Deno;

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

path: string | URL
optional
options: RemoveOptions