Skip to content

Commit 0c83169

Browse files
Mohit-Raj-Saxenaaduh95
authored andcommitted
doc: add File modes cross-references in fs methods
Adds links to the File modes section from fsPromises.open(), fsPromises.mkdir(), and fs.mkdir() to improve discoverability of file permission documentation. PR-URL: #60286 Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
1 parent 311a04c commit 0c83169

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

doc/api/fs.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,8 @@ added: v10.0.0
12271227
* `path` {string|Buffer|URL}
12281228
* `options` {Object|integer}
12291229
* `recursive` {boolean} **Default:** `false`
1230-
* `mode` {string|integer} Not supported on Windows. **Default:** `0o777`.
1230+
* `mode` {string|integer} Not supported on Windows. See [File modes][]
1231+
for more details. **Default:** `0o777`.
12311232
* Returns: {Promise} Upon success, fulfills with `undefined` if `recursive`
12321233
is `false`, or the first directory path created if `recursive` is `true`.
12331234
@@ -1362,7 +1363,8 @@ changes:
13621363
* `flags` {string|number} See [support of file system `flags`][].
13631364
**Default:** `'r'`.
13641365
* `mode` {string|integer} Sets the file mode (permission and sticky bits)
1365-
if the file is created. **Default:** `0o666` (readable and writable)
1366+
if the file is created. See [File modes][] for more details.
1367+
**Default:** `0o666` (readable and writable)
13661368
* Returns: {Promise} Fulfills with a {FileHandle} object.
13671369
13681370
Opens a {FileHandle}.
@@ -3447,7 +3449,8 @@ changes:
34473449
* `path` {string|Buffer|URL}
34483450
* `options` {Object|integer}
34493451
* `recursive` {boolean} **Default:** `false`
3450-
* `mode` {string|integer} Not supported on Windows. **Default:** `0o777`.
3452+
* `mode` {string|integer} Not supported on Windows. See [File modes][]
3453+
for more details. **Default:** `0o777`.
34513454
* `callback` {Function}
34523455
* `err` {Error}
34533456
* `path` {string|undefined} Present only if a directory is created with
@@ -8688,6 +8691,7 @@ the file contents.
86888691
[Common System Errors]: errors.md#common-system-errors
86898692
[FS constants]: #fs-constants
86908693
[File access constants]: #file-access-constants
8694+
[File modes]: #file-modes
86918695
[MDN-Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
86928696
[MDN-Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type
86938697
[MSDN-Rel-Path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths

0 commit comments

Comments
 (0)