@@ -1048,6 +1048,16 @@ Renames `oldPath` to `newPath`.
10481048<!-- YAML
10491049added: v10.0.0
10501050changes:
1051+ - version: REPLACEME
1052+ pr-url: https://github.com/nodejs/node/pull/37216
1053+ description: " Using ` fsPromises.rmdir(path, { recursive: true })` on a ` path`
1054+ that is a file is no longer permitted and results in an
1055+ ` ENOENT` error on Windows and an ` ENOTDIR` error on POSIX ."
1056+ - version: REPLACEME
1057+ pr-url: https://github.com/nodejs/node/pull/37216
1058+ description: " Using ` fsPromises.rmdir(path, { recursive: true })` on a ` path`
1059+ that does not exist is no longer permitted and results in a
1060+ ` ENOENT` error."
10511061 - version: REPLACEME
10521062 pr-url: https://github.com/nodejs/node/pull/37302
10531063 description: The `recursive` option is deprecated, using it triggers a
@@ -1075,8 +1085,8 @@ changes:
10751085 represents the number of retries. This option is ignored if the `recursive`
10761086 option is not `true`. **Default:** `0`.
10771087 * `recursive` {boolean} If `true`, perform a recursive directory removal. In
1078- recursive mode, errors are not reported if `path` does not exist, and
1079- operations are retried on failure. **Default:** `false`. **Deprecated**.
1088+ recursive mode, operations are retried on failure. **Default:** `false`.
1089+ **Deprecated**.
10801090 * `retryDelay` {integer} The amount of time in milliseconds to wait between
10811091 retries. This option is ignored if the `recursive` option is not `true`.
10821092 **Default:** `100`.
@@ -1088,10 +1098,8 @@ Using `fsPromises.rmdir()` on a file (not a directory) results in the
10881098promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`
10891099error on POSIX.
10901100
1091- Setting `recursive` to `true` results in behavior similar to the Unix command
1092- `rm -rf`: an error will not be raised for paths that do not exist, and paths
1093- that represent files will be deleted. The `recursive` option is deprecated,
1094- `ENOTDIR` and `ENOENT` will be thrown in the future.
1101+ To get a behavior similar to the `rm -rf` Unix command, use
1102+ [`fsPromises.rm()`][] with options `{ recursive: true, force: true }`.
10951103
10961104### `fsPromises.rm(path[, options])`
10971105<!-- YAML
@@ -3146,6 +3154,16 @@ rename('oldFile.txt', 'newFile.txt', (err) => {
31463154<!-- YAML
31473155added: v0.0 .2
31483156changes:
3157+ - version: REPLACEME
3158+ pr- url: https: // github.com/nodejs/node/pull/37216
3159+ description: " Using `fs.rmdir(path, { recursive: true })` on a `path` that is
3160+ a file is no longer permitted and results in an `ENOENT` error
3161+ on Windows and an `ENOTDIR` error on POSIX."
3162+ - version: REPLACEME
3163+ pr- url: https: // github.com/nodejs/node/pull/37216
3164+ description: " Using `fs.rmdir(path, { recursive: true })` on a `path` that
3165+ does not exist is no longer permitted and results in a `ENOENT`
3166+ error."
31493167 - version: REPLACEME
31503168 pr- url: https: // github.com/nodejs/node/pull/37302
31513169 description: The ` recursive` option is deprecated, using it triggers a
@@ -3185,8 +3203,8 @@ changes:
31853203 represents the number of retries . This option is ignored if the ` recursive`
31863204 option is not ` true` . ** Default: ** ` 0` .
31873205 * ` recursive` {boolean} If ` true` , perform a recursive directory removal . In
3188- recursive mode, errors are not reported if ` path ` does not exist, and
3189- operations are retried on failure. ** Default : ** ` false ` . ** Deprecated** .
3206+ recursive mode, operations are retried on failure. ** Default : ** ` false ` .
3207+ ** Deprecated** .
31903208 * ` retryDelay` {integer} The amount of time in milliseconds to wait between
31913209 retries . This option is ignored if the ` recursive` option is not ` true` .
31923210 ** Default: ** ` 100` .
@@ -3199,10 +3217,8 @@ to the completion callback.
31993217Using ` fs.rmdir()` on a file (not a directory) results in an ` ENOENT` error on
32003218Windows and an ` ENOTDIR` error on POSIX .
32013219
3202- Setting ` recursive` to ` true` results in behavior similar to the Unix command
3203- ` rm -rf` : an error will not be raised for paths that do not exist, and paths
3204- that represent files will be deleted . The ` recursive` option is deprecated,
3205- ` ENOTDIR` and ` ENOENT` will be thrown in the future.
3220+ To get a behavior similar to the ` rm -rf` Unix command, use [` fs.rm()` ][]
3221+ with options ` { recursive: true, force: true }` .
32063222
32073223### ` fs.rm(path[, options], callback)`
32083224<!-- YAML
@@ -4777,6 +4793,16 @@ See the POSIX rename(2) documentation for more details.
47774793<!-- YAML
47784794added: v0.1.21
47794795changes:
4796+ - version: REPLACEME
4797+ pr-url: https://github.com/nodejs/node/pull/37216
4798+ description: "Using ` fs .rmdirSync (path, { recursive: true })` on a ` path`
4799+ that is a file is no longer permitted and results in an
4800+ ` ENOENT ` error on Windows and an ` ENOTDIR ` error on POSIX."
4801+ - version: REPLACEME
4802+ pr-url: https://github.com/nodejs/node/pull/37216
4803+ description: "Using ` fs .rmdirSync (path, { recursive: true })` on a ` path`
4804+ that does not exist is no longer permitted and results in a
4805+ ` ENOENT ` error."
47804806 - version: REPLACEME
47814807 pr-url: https://github.com/nodejs/node/pull/37302
47824808 description: The ` recursive` option is deprecated, using it triggers a
@@ -4808,8 +4834,8 @@ changes:
48084834 represents the number of retries. This option is ignored if the ` recursive`
48094835 option is not ` true ` . **Default:** ` 0 ` .
48104836 * ` recursive` {boolean} If ` true ` , perform a recursive directory removal. In
4811- recursive mode, errors are not reported if ` path ` does not exist, and
4812- operations are retried on failure. **Default:** ` false ` . **Deprecated**.
4837+ recursive mode, operations are retried on failure. **Default:** ` false ` .
4838+ **Deprecated**.
48134839 * ` retryDelay` {integer} The amount of time in milliseconds to wait between
48144840 retries. This option is ignored if the ` recursive` option is not ` true ` .
48154841 **Default:** ` 100 ` .
@@ -4819,10 +4845,8 @@ Synchronous rmdir(2). Returns `undefined`.
48194845Using ` fs .rmdirSync ()` on a file (not a directory) results in an ` ENOENT ` error
48204846on Windows and an ` ENOTDIR ` error on POSIX.
48214847
4822- Setting ` recursive` to ` true ` results in behavior similar to the Unix command
4823- ` rm - rf` : an error will not be raised for paths that do not exist, and paths
4824- that represent files will be deleted. The ` recursive` option is deprecated,
4825- ` ENOTDIR ` and ` ENOENT ` will be thrown in the future.
4848+ To get a behavior similar to the ` rm - rf` Unix command, use [` fs .rmSync ()` ][]
4849+ with options ` { recursive: true , force: true }` .
48264850
48274851### ` fs .rmSync (path[, options])`
48284852<!-- YAML
@@ -6670,6 +6694,8 @@ the file contents.
66706694[` fs .readdirSync ()` ]: #fs_fs_readdirsync_path_options
66716695[` fs .readv ()` ]: #fs_fs_readv_fd_buffers_position_callback
66726696[` fs .realpath ()` ]: #fs_fs_realpath_path_options_callback
6697+ [` fs .rm ()` ]: #fs_fs_rm_path_options_callback
6698+ [` fs .rmSync ()` ]: #fs_fs_rmsync_path_options
66736699[` fs .rmdir ()` ]: #fs_fs_rmdir_path_options_callback
66746700[` fs .stat ()` ]: #fs_fs_stat_path_options_callback
66756701[` fs .symlink ()` ]: #fs_fs_symlink_target_path_type_callback
@@ -6681,6 +6707,7 @@ the file contents.
66816707[` fs .writev ()` ]: #fs_fs_writev_fd_buffers_position_callback
66826708[` fsPromises .open ()` ]: #fs_fspromises_open_path_flags_mode
66836709[` fsPromises .opendir ()` ]: #fs_fspromises_opendir_path_options
6710+ [` fsPromises .rm ()` ]: #fs_fspromises_rm_path_options
66846711[` fsPromises .utimes ()` ]: #fs_fspromises_utimes_path_atime_mtime
66856712[` inotify (7 )` ]: https://man7.org/linux/man-pages/man7/inotify.7.html
66866713[` kqueue (2 )` ]: https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
0 commit comments