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

x/ayonli_jsext/fs.ts>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/fs.ts";

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: string
optional
options: RemoveOptions = [UNSUPPORTED]

Returns

Promise<void>