moveSync
import { moveSync } from "jsr:@ende/fs";function
function moveSync(src: string | URL, dest: string | URL, options?: MoveOptions): voidSynchronously 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 value that returns once the operation completes.
Example: Basic usage
import { moveSync } from "@ende/fs/move";
moveSync("./foo", "./bar");
This will move the file or directory at ./foo to ./bar without
overwriting.
Example: Overwriting
import { moveSync } from "@ende/fs/move";
moveSync("./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.