Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/js/lib.deno.ns.d.ts>Deno.remove

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.remove
import { Deno } from "https://deno.land/x/deno@v1.0.0/cli/js/lib.deno.ns.d.ts";
const { remove } = Deno;

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

path: string
optional
options: RemoveOptions

Returns

Promise<void>