summaryrefslogtreecommitdiff
path: root/cli/js/mkdir.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/mkdir.ts')
-rw-r--r--cli/js/mkdir.ts24
1 files changed, 13 insertions, 11 deletions
diff --git a/cli/js/mkdir.ts b/cli/js/mkdir.ts
index 532d2b73c..ecb15a9c5 100644
--- a/cli/js/mkdir.ts
+++ b/cli/js/mkdir.ts
@@ -26,19 +26,24 @@ function mkdirArgs(
}
export interface MkdirOption {
+ /** Defaults to `false`. If set to `true`, means that any intermediate
+ * directories will also be created (as with the shell command `mkdir -p`).
+ * Intermediate directories are created with the same permissions.
+ * When recursive is set to `true`, succeeds silently (without changing any
+ * permissions) if a directory already exists at the path. */
recursive?: boolean;
+ /** Permissions to use when creating the directory (defaults to `0o777`,
+ * before the process's umask).
+ * Does nothing/raises on Windows. */
mode?: number;
}
-/** Creates a new directory with the specified path synchronously.
- * If `recursive` is set to true, nested directories will be created (also known
- * as "mkdir -p").
- * `mode` sets permission bits (before umask) on UNIX and does nothing on
- * Windows.
+/** Synchronously creates a new directory with the specified path.
*
* Deno.mkdirSync("new_dir");
* Deno.mkdirSync("nested/directories", { recursive: true });
- */
+ *
+ * Requires `allow-write` permission. */
export function mkdirSync(
path: string,
optionsOrRecursive?: MkdirOption | boolean,
@@ -48,14 +53,11 @@ export function mkdirSync(
}
/** Creates a new directory with the specified path.
- * If `recursive` is set to true, nested directories will be created (also known
- * as "mkdir -p").
- * `mode` sets permission bits (before umask) on UNIX and does nothing on
- * Windows.
*
* await Deno.mkdir("new_dir");
* await Deno.mkdir("nested/directories", { recursive: true });
- */
+ *
+ * Requires `allow-write` permission. */
export async function mkdir(
path: string,
optionsOrRecursive?: MkdirOption | boolean,