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

x/ayonli_jsext/esm/fs.js>rename

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

Renames the file or directory from the old path to the new path.

Examples

Example 1

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

await rename("/path/to/old.txt", "/path/to/new.txt");

Example 2

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

const root = await window.showDirectoryPicker();
await rename("/path/to/old.txt", "/path/to/new.txt", { root });

Parameters

oldPath
newPath
optional
options = [UNSUPPORTED]