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

x/ayonli_jsext/esm/fs.js>remove

A JavaScript extension package for building strong and modern applications.
Latest
function remove
import { remove } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/fs.js";

Removes the file or directory of the given path from the file system.

Examples

Example 1

// with the default storage
import { remove } from "@ayonli/jsext/fs";

await remove("/path/to/file.txt");

Example 2

// with a user-selected directory as root (Chromium only)
import { remove } from "@ayonli/jsext/fs";

const root = await window.showDirectoryPicker();
await remove("/path/to/file.txt", { root });

Example 3

// remove the directory and its contents recursively
import { remove } from "@ayonli/jsext/fs";

await remove("/path/to/dir", { recursive: true });

Parameters

path
optional
options = [UNSUPPORTED]