ensureDirSync
import { ensureDirSync } from "jsr:@ende/fs";function
function ensureDirSync(dir: string | URL): voidSynchronously ensures that the directory exists, like
mkdir -p.
If the directory already exists, this function does nothing. If the directory does not exist, it is created.
Requires --allow-read and --allow-write permissions.
dir: string | URLThe path of the directory to ensure, as a string or URL.
Returns
A void value that returns once the directory exists.
Example: Usage
import { ensureDirSync } from "@ende/fs/ensure-dir";
ensureDirSync("./bar");
See also
https://docs.ende.sh/runtime/manual/basics/permissions#file-system-access for more information on Ende's permissions system.