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
Example 1
// with the default storage
import { rename } from "@ayonli/jsext/fs";
await rename("/path/to/old.txt", "/path/to/new.txt");
Example 2
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 });