@@ -1046,6 +1046,16 @@ Renames `oldPath` to `newPath`.
10461046<!-- YAML
10471047added: v10.0.0
10481048changes:
1049+ - version: REPLACEME
1050+ pr-url: https://github.com/nodejs/node/pull/37216
1051+ description: " Using ` fsPromises.rmdir(path, { recursive: true })` on a ` path`
1052+ that is a file is no longer permitted and results in an
1053+ ` ENOENT` error on Windows and an ` ENOTDIR` error on POSIX ."
1054+ - version: REPLACEME
1055+ pr-url: https://github.com/nodejs/node/pull/37216
1056+ description: " Using ` fsPromises.rmdir(path, { recursive: true })` on a ` path`
1057+ that does not exist is no longer permitted and results in a
1058+ ` ENOENT` error."
10491059 - version:
10501060 - v13.3.0
10511061 - v12.16.0
@@ -1069,8 +1079,8 @@ changes:
10691079 represents the number of retries. This option is ignored if the `recursive`
10701080 option is not `true`. **Default:** `0`.
10711081 * `recursive` {boolean} If `true`, perform a recursive directory removal. In
1072- recursive mode, errors are not reported if `path` does not exist, and
1073- operations are retried on failure. **Default:** `false` .
1082+ recursive mode, operations are retried on failure. **Default:** `false`.
1083+ **Deprecated** .
10741084 * `retryDelay` {integer} The amount of time in milliseconds to wait between
10751085 retries. This option is ignored if the `recursive` option is not `true`.
10761086 **Default:** `100`.
@@ -1082,11 +1092,8 @@ Using `fsPromises.rmdir()` on a file (not a directory) results in the
10821092promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`
10831093error on POSIX.
10841094
1085- Setting `recursive` to `true` results in behavior similar to the Unix command
1086- `rm -rf`: an error will not be raised for paths that do not exist, and paths
1087- that represent files will be deleted. The permissive behavior of the
1088- `recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in
1089- the future.
1095+ To get a behavior similar to the `rm -rf` Unix command, use
1096+ [`fsPromises.rm()`][] with options `{ recursive: true, force: true }`.
10901097
10911098### `fsPromises.rm(path[, options])`
10921099<!-- YAML
@@ -3131,6 +3138,16 @@ rename('oldFile.txt', 'newFile.txt', (err) => {
31313138<!-- YAML
31323139added: v0.0 .2
31333140changes:
3141+ - version: REPLACEME
3142+ pr- url: https: // github.com/nodejs/node/pull/37216
3143+ description: " Using `fs.rmdir(path, { recursive: true })` on a `path` that is
3144+ a file is no longer permitted and results in an `ENOENT` error
3145+ on Windows and an `ENOTDIR` error on POSIX."
3146+ - version: REPLACEME
3147+ pr- url: https: // github.com/nodejs/node/pull/37216
3148+ description: " Using `fs.rmdir(path, { recursive: true })` on a `path` that
3149+ does not exist is no longer permitted and results in a `ENOENT`
3150+ error."
31343151 - version:
31353152 - v13.3 .0
31363153 - v12.16 .0
@@ -3166,8 +3183,8 @@ changes:
31663183 represents the number of retries . This option is ignored if the ` recursive`
31673184 option is not ` true` . ** Default: ** ` 0` .
31683185 * ` recursive` {boolean} If ` true` , perform a recursive directory removal . In
3169- recursive mode, errors are not reported if ` path ` does not exist, and
3170- operations are retried on failure. ** Default : ** ` false ` .
3186+ recursive mode, operations are retried on failure. ** Default : ** ` false ` .
3187+ ** Deprecated ** .
31713188 * ` retryDelay` {integer} The amount of time in milliseconds to wait between
31723189 retries . This option is ignored if the ` recursive` option is not ` true` .
31733190 ** Default: ** ` 100` .
@@ -3180,11 +3197,8 @@ to the completion callback.
31803197Using ` fs.rmdir()` on a file (not a directory) results in an ` ENOENT` error on
31813198Windows and an ` ENOTDIR` error on POSIX .
31823199
3183- Setting ` recursive` to ` true` results in behavior similar to the Unix command
3184- ` rm -rf` : an error will not be raised for paths that do not exist, and paths
3185- that represent files will be deleted . The permissive behavior of the
3186- ` recursive` option is deprecated, ` ENOTDIR` and ` ENOENT` will be thrown in
3187- the future.
3200+ To get a behavior similar to the ` rm -rf` Unix command, use [` fs.rm()` ][]
3201+ with options ` { recursive: true, force: true }` .
31883202
31893203### ` fs.rm(path[, options], callback)`
31903204<!-- YAML
@@ -4751,6 +4765,16 @@ See the POSIX rename(2) documentation for more details.
47514765<!-- YAML
47524766added: v0.1.21
47534767changes:
4768+ - version: REPLACEME
4769+ pr-url: https://github.com/nodejs/node/pull/37216
4770+ description: "Using ` fs .rmdirSync (path, { recursive: true })` on a ` path`
4771+ that is a file is no longer permitted and results in an
4772+ ` ENOENT ` error on Windows and an ` ENOTDIR ` error on POSIX."
4773+ - version: REPLACEME
4774+ pr-url: https://github.com/nodejs/node/pull/37216
4775+ description: "Using ` fs .rmdirSync (path, { recursive: true })` on a ` path`
4776+ that does not exist is no longer permitted and results in a
4777+ ` ENOENT ` error."
47544778 - version:
47554779 - v13.3.0
47564780 - v12.16.0
@@ -4778,8 +4802,8 @@ changes:
47784802 represents the number of retries. This option is ignored if the ` recursive`
47794803 option is not ` true ` . **Default:** ` 0 ` .
47804804 * ` recursive` {boolean} If ` true ` , perform a recursive directory removal. In
4781- recursive mode, errors are not reported if ` path ` does not exist, and
4782- operations are retried on failure. **Default:** ` false ` .
4805+ recursive mode, operations are retried on failure. **Default:** ` false ` .
4806+ **Deprecated** .
47834807 * ` retryDelay` {integer} The amount of time in milliseconds to wait between
47844808 retries. This option is ignored if the ` recursive` option is not ` true ` .
47854809 **Default:** ` 100 ` .
@@ -4789,11 +4813,8 @@ Synchronous rmdir(2). Returns `undefined`.
47894813Using ` fs .rmdirSync ()` on a file (not a directory) results in an ` ENOENT ` error
47904814on Windows and an ` ENOTDIR ` error on POSIX.
47914815
4792- Setting ` recursive` to ` true ` results in behavior similar to the Unix command
4793- ` rm - rf` : an error will not be raised for paths that do not exist, and paths
4794- that represent files will be deleted. The permissive behavior of the
4795- ` recursive` option is deprecated, ` ENOTDIR ` and ` ENOENT ` will be thrown in
4796- the future.
4816+ To get a behavior similar to the ` rm - rf` Unix command, use [` fs .rmSync ()` ][]
4817+ with options ` { recursive: true , force: true }` .
47974818
47984819### ` fs .rmSync (path[, options])`
47994820<!-- YAML
@@ -6641,6 +6662,8 @@ the file contents.
66416662[` fs .readdirSync ()` ]: #fs_fs_readdirsync_path_options
66426663[` fs .readv ()` ]: #fs_fs_readv_fd_buffers_position_callback
66436664[` fs .realpath ()` ]: #fs_fs_realpath_path_options_callback
6665+ [` fs .rm ()` ]: #fs_fs_rm_path_options_callback
6666+ [` fs .rmSync ()` ]: #fs_fs_rmsync_path_options
66446667[` fs .rmdir ()` ]: #fs_fs_rmdir_path_options_callback
66456668[` fs .stat ()` ]: #fs_fs_stat_path_options_callback
66466669[` fs .symlink ()` ]: #fs_fs_symlink_target_path_type_callback
@@ -6652,6 +6675,7 @@ the file contents.
66526675[` fs .writev ()` ]: #fs_fs_writev_fd_buffers_position_callback
66536676[` fsPromises .open ()` ]: #fs_fspromises_open_path_flags_mode
66546677[` fsPromises .opendir ()` ]: #fs_fspromises_opendir_path_options
6678+ [` fsPromises .rm ()` ]: #fs_fspromises_rm_path_options
66556679[` fsPromises .utimes ()` ]: #fs_fspromises_utimes_path_atime_mtime
66566680[` inotify (7 )` ]: https://man7.org/linux/man-pages/man7/inotify.7.html
66576681[` kqueue (2 )` ]: https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
0 commit comments