UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

15 lines (14 loc) 494 B
/** * Ensures that the directory exists. * If the directory structure does not exist, it is created. Like mkdir -p. * @param directory The path to the directory to ensure exists. * @example * ```javascript * import ensureDir from "@visulima/fs/ensure/ensure-dir"; * * await ensureDir("/tmp/foo/bar/baz"); * // Creates the directory structure /tmp/foo/bar/baz if it doesn't exist * ``` */ declare const ensureDir: (directory: URL | string) => Promise<void>; export default ensureDir;