From b8bd45683941e15a706faf096a691d9267374855 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 8 Oct 2020 16:38:09 -0400 Subject: [PATCH 1/2] doc: make fs.rm()'s force docs consistent This commit updates the documentation for the force option to fs.rm(). Prior to this commit, the documentation was inconsistent with the surrounding documentation. PR-URL: https://github.com/nodejs/node/pull/35561 Reviewed-By: Daijiro Wachi Reviewed-By: Ben Coe Reviewed-By: Jiawen Geng Reviewed-By: Harshitha K P Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- doc/api/fs.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 1b54d944e9eea4..129a18c7d7d0f9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3612,7 +3612,8 @@ added: REPLACEME * `path` {string|Buffer|URL} * `options` {Object} - * `force` don't error on nonexistent path + * `force` {boolean} When `true`, exceptions will be ignored if `path` does + not exist. **Default:** `false`. * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option @@ -3637,7 +3638,8 @@ added: REPLACEME * `path` {string|Buffer|URL} * `options` {Object} - * `force` Ignore errors + * `force` {boolean} When `true`, exceptions will be ignored if `path` does + not exist. **Default:** `false`. * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option @@ -5555,7 +5557,8 @@ added: REPLACEME * `path` {string|Buffer|URL} * `options` {Object} - * `force` Ignore errors + * `force` {boolean} When `true`, exceptions will be ignored if `path` does + not exist. **Default:** `false`. * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option From 71a48c338a7e1a6fe2474f7925009fdfb82938d9 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 8 Oct 2020 16:39:59 -0400 Subject: [PATCH 2/2] doc: remove incorrect synchronous label fsPromises.rm() is not synchronous. PR-URL: https://github.com/nodejs/node/pull/35561 Reviewed-By: Daijiro Wachi Reviewed-By: Ben Coe Reviewed-By: Jiawen Geng Reviewed-By: Harshitha K P Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- doc/api/fs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 129a18c7d7d0f9..aaf44608613543 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -5570,8 +5570,8 @@ added: REPLACEME retries. This option is ignored if the `recursive` option is not `true`. **Default:** `100`. -Synchronously removes files and directories (modeled on the standard POSIX `rm` -utility). Resolves the `Promise` with no arguments on success. +Removes files and directories (modeled on the standard POSIX `rm` utility). +Resolves the `Promise` with no arguments on success. ### `fsPromises.stat(path[, options])`