From 65208d038e76cf24ba1afe6768d7b053b3bbf3f3 Mon Sep 17 00:00:00 2001 From: iwko Date: Sun, 10 Jun 2018 15:28:00 +0200 Subject: [PATCH] doc: improve documentation of fs sync methods Add links to async methods and make wording consistent. PR-URL: https://github.com/nodejs/node/pull/21243 Refs: https://github.com/nodejs/node/issues/21197 Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Vse Mozhet Byt Reviewed-By: Jamie Davis Reviewed-By: Matteo Collina --- doc/api/fs.md | 63 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index aa1a43f1ecc..3f19ccc3cd5 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1137,8 +1137,8 @@ changes: * `path` {string|Buffer|URL} * `mode` {integer} -Synchronously changes the permissions of a file. Returns `undefined`. -This is the synchronous version of [`fs.chmod()`][]. +For detailed information, see the documentation of the asynchronous version of +this API: [`fs.chmod()`][]. See also: chmod(2). @@ -1567,13 +1567,16 @@ changes: * `path` {string|Buffer|URL} * Returns: {boolean} -Synchronous version of [`fs.exists()`][]. Returns `true` if the path exists, `false` otherwise. +For detailed information, see the documentation of the asynchronous version of +this API: [`fs.exists()`][]. + `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback` parameter to `fs.exists()` accepts parameters that are inconsistent with other Node.js callbacks. `fs.existsSync()` does not use a callback. + ## fs.fchmod(fd, mode, callback)