summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
authorChris Knight <cknight1234@gmail.com>2020-03-19 01:25:01 +0000
committerGitHub <noreply@github.com>2020-03-18 21:25:01 -0400
commit54d1f299dc774c695056f04cfe1013287b53b86a (patch)
treeb9fac6c4014118e6711feb11d9fe6411d8870fda /cli/js
parent2a34cbfaf9530e86f5c049f82f8e35c086e22263 (diff)
Chmod API documentation improvements (#4427)
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/lib.deno.ns.d.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts
index 3ebd5bc9d..ac52bb9a3 100644
--- a/cli/js/lib.deno.ns.d.ts
+++ b/cli/js/lib.deno.ns.d.ts
@@ -948,6 +948,10 @@ declare namespace Deno {
*
* Deno.chmodSync("/path/to/file", 0o666);
*
+ * For a full description, see [chmod](#chmod)
+ *
+ * NOTE: This API currently has no effect on Windows
+ *
* Requires `allow-write` permission. */
export function chmodSync(path: string, mode: number): void;
@@ -956,6 +960,26 @@ declare namespace Deno {
*
* await Deno.chmod("/path/to/file", 0o666);
*
+ * The mode is a sequence of 3 octal numbers. The first/left-most number
+ * specifies the permissions for the owner. The second number specifies the
+ * permissions for the group. The last/right-most number specifies the
+ * permissions for others. For example, with a mode of 0o764, the owner (7) can
+ * read/write/execute, the group (6) can read/write and everyone else (4) can
+ * read only.
+ *
+ * | Number | Description |
+ * | ------ | ----------- |
+ * | 7 | read, write, and execute |
+ * | 6 | read and write |
+ * | 5 | read and execute |
+ * | 4 | read only |
+ * | 3 | write and execute |
+ * | 2 | write only |
+ * | 1 | execute only |
+ * | 0 | no permission |
+ *
+ * NOTE: This API currently has no effect on Windows
+ *
* Requires `allow-write` permission. */
export function chmod(path: string, mode: number): Promise<void>;