import { pickDirectory } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/dialog.js";
Opens the file picker dialog and pick a directory, this function returns the
directory's path or FileSystemDirectoryHandle
in the browser.
NOTE: Browser support is limited to the chromium-based browsers.
Examples
Example 1
Example 1
import { pickDirectory } from "@ayonli/jsext/dialog";
// Node.js, Deno, Bun
const dirname = await pickDirectory() as string | null;
// Browser (Chrome)
const handle = await pickDirectory() as FileSystemDirectoryHandle | null;