From fcbdb0686d9c20cecb8ab70ac6bad04fb8b23070 Mon Sep 17 00:00:00 2001 From: bcoe Date: Thu, 1 Oct 2020 14:40:50 -0700 Subject: [PATCH] fs: remove experimental from rmdir recursive Refs: https://github.com/nodejs/node/issues/34278 PR-URL: https://github.com/nodejs/node/pull/35171 Reviewed-By: Christopher Hiller Reviewed-By: Jiawen Geng Reviewed-By: Matteo Collina Reviewed-By: Michael Dawson Reviewed-By: Joyee Cheung --- doc/api/fs.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 44dbb83247f3ce..72357443ecef15 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3502,8 +3502,6 @@ changes: it will emit a deprecation warning with id DEP0013. --> -> Stability: 1 - Recursive removal is experimental. - * `path` {string|Buffer|URL} * `options` {Object} * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or @@ -3526,6 +3524,12 @@ to the completion callback. Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. +Setting `recursive` to `true` results in behavior similar to the Unix command +`rm -rf`: an error will not be raised for paths that do not exist, and paths +that represent files will be deleted. The permissive behavior of the +`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in +the future. + ## `fs.rmdirSync(path[, options])` -> Stability: 1 - Recursive removal is experimental. - * `path` {string|Buffer|URL} * `options` {Object} * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or @@ -3570,6 +3572,12 @@ Synchronous rmdir(2). Returns `undefined`. Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. +Setting `recursive` to `true` results in behavior similar to the Unix command +`rm -rf`: an error will not be raised for paths that do not exist, and paths +that represent files will be deleted. The permissive behavior of the +`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in +the future. + ## `fs.stat(path[, options], callback)`