From 749745f98f73731aa52afceaccb923fd060cbf80 Mon Sep 17 00:00:00 2001 From: Babu-Bhai-No-1 Date: Fri, 17 Oct 2025 03:03:05 +0530 Subject: [PATCH 1/2] 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. --- doc/api/fs.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index f09395cb123150..38ded28f9f1195 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1231,7 +1231,8 @@ added: v10.0.0 * `path` {string|Buffer|URL} * `options` {Object|integer} * `recursive` {boolean} **Default:** `false` - * `mode` {string|integer} Not supported on Windows. **Default:** `0o777`. + * `mode` {string|integer} Not supported on Windows. See [File modes][] + for more details. **Default:** `0o777`. * Returns: {Promise} Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. @@ -1366,7 +1367,8 @@ changes: * `flags` {string|number} See [support of file system `flags`][]. **Default:** `'r'`. * `mode` {string|integer} Sets the file mode (permission and sticky bits) - if the file is created. **Default:** `0o666` (readable and writable) + if the file is created. See [File modes][] for more details. + **Default:** `0o666` (readable and writable) * Returns: {Promise} Fulfills with a {FileHandle} object. Opens a {FileHandle}. @@ -3454,7 +3456,8 @@ changes: * `path` {string|Buffer|URL} * `options` {Object|integer} * `recursive` {boolean} **Default:** `false` - * `mode` {string|integer} Not supported on Windows. **Default:** `0o777`. + * `mode` {string|integer} Not supported on Windows. See [File modes][] + for more details. **Default:** `0o777`. * `callback` {Function} * `err` {Error} * `path` {string|undefined} Present only if a directory is created with @@ -8714,6 +8717,7 @@ the file contents. [`filehandle.writeFile()`]: #filehandlewritefiledata-options [`fs.access()`]: #fsaccesspath-mode-callback [`fs.accessSync()`]: #fsaccesssyncpath-mode +[File modes]: #file-modes [`fs.chmod()`]: #fschmodpath-mode-callback [`fs.chown()`]: #fschownpath-uid-gid-callback [`fs.copyFile()`]: #fscopyfilesrc-dest-mode-callback From d7d155c95d808c1a92332960fc5e3def7a32cad0 Mon Sep 17 00:00:00 2001 From: Babu-Bhai-No-1 Date: Sun, 9 Nov 2025 12:48:08 +0530 Subject: [PATCH 2/2] doc: fix link reference ordering for File modes --- doc/api/fs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 38ded28f9f1195..4351a62358a6fc 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -8700,6 +8700,7 @@ the file contents. [Common System Errors]: errors.md#common-system-errors [FS constants]: #fs-constants [File access constants]: #file-access-constants +[File modes]: #file-modes [MDN-Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date [MDN-Number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type [MSDN-Rel-Path]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths @@ -8717,7 +8718,6 @@ the file contents. [`filehandle.writeFile()`]: #filehandlewritefiledata-options [`fs.access()`]: #fsaccesspath-mode-callback [`fs.accessSync()`]: #fsaccesssyncpath-mode -[File modes]: #file-modes [`fs.chmod()`]: #fschmodpath-mode-callback [`fs.chown()`]: #fschownpath-uid-gid-callback [`fs.copyFile()`]: #fscopyfilesrc-dest-mode-callback