summaryrefslogtreecommitdiff
path: root/cli/js/mkdir.ts
diff options
context:
space:
mode:
authordubiousjim <dubiousjim@gmail.com>2020-03-02 10:19:42 -0500
committerGitHub <noreply@github.com>2020-03-02 10:19:42 -0500
commit6cd46fa3ef4b12f35a60f1a33c7f038c06b5fc71 (patch)
treee8ef21a936ebac529a7c8e87681123fbd225ff5f /cli/js/mkdir.ts
parent809019dc6e9a80843affc927fa7a52cd41e76471 (diff)
Cleanup comments and internal variables (#4205)
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,