import { ensureDir } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/fs.js";
Ensures the directory exists, creating it (and any parent directory) if not.
Examples
Example 1
Example 1
// with the default storage
import { ensureDir } from "@ayonli/jsext/fs";
await ensureDir("/path/to/dir");
Example 2
Example 2
// with a user-selected directory as root (Chromium only)
import { ensureDir } from "@ayonli/jsext/fs";
const root = await window.showDirectoryPicker();
await ensureDir("/path/to/dir", { root });