move
import { move } from "jsr:@ende/fs";function
async function move(src: string | URL, dest: string | URL, options?: MoveOptions): Promise<void>Asynchronously moves a file or directory (along with its contents).
Requires --allow-read and --allow-write permissions.
src: string | URLThe source file or directory as a string or URL.
dest: string | URLThe destination file or directory as a string or URL.
options?: MoveOptionsOptions for the move operation.
Returns
A void promise that resolves once the operation completes.
Example: Basic usage
import { move } from "@ende/fs/move";
await move("./foo", "./bar");
This will move the file or directory at ./foo to ./bar without
overwriting.
Example: Overwriting
import { move } from "@ende/fs/move";
await move("./foo", "./bar", { overwrite: true });
This will move the file or directory at ./foo to ./bar, overwriting
./bar if it already exists.
See also
https://docs.ende.sh/runtime/manual/basics/permissions#file-system-access for more information on Ende's permissions system.