@@ -1046,6 +1046,16 @@ Renames `oldPath` to `newPath`.
1046
1046
<!-- YAML
1047
1047
added: v10.0.0
1048
1048
changes:
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."
1049
1059
- version:
1050
1060
- v13.3.0
1051
1061
- v12.16.0
@@ -1069,8 +1079,8 @@ changes:
1069
1079
represents the number of retries. This option is ignored if the `recursive`
1070
1080
option is not `true`. **Default:** `0`.
1071
1081
* `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** .
1074
1084
* `retryDelay` {integer} The amount of time in milliseconds to wait between
1075
1085
retries. This option is ignored if the `recursive` option is not `true`.
1076
1086
**Default:** `100`.
@@ -1082,11 +1092,8 @@ Using `fsPromises.rmdir()` on a file (not a directory) results in the
1082
1092
promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`
1083
1093
error on POSIX.
1084
1094
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 }`.
1090
1097
1091
1098
### `fsPromises.rm(path[, options])`
1092
1099
<!-- YAML
@@ -3131,6 +3138,16 @@ rename('oldFile.txt', 'newFile.txt', (err) => {
3131
3138
<!-- YAML
3132
3139
added: v0.0 .2
3133
3140
changes:
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."
3134
3151
- version:
3135
3152
- v13.3 .0
3136
3153
- v12.16 .0
@@ -3166,8 +3183,8 @@ changes:
3166
3183
represents the number of retries . This option is ignored if the ` recursive`
3167
3184
option is not ` true` . ** Default: ** ` 0` .
3168
3185
* ` 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 ** .
3171
3188
* ` retryDelay` {integer} The amount of time in milliseconds to wait between
3172
3189
retries . This option is ignored if the ` recursive` option is not ` true` .
3173
3190
** Default: ** ` 100` .
@@ -3180,11 +3197,8 @@ to the completion callback.
3180
3197
Using ` fs.rmdir()` on a file (not a directory) results in an ` ENOENT` error on
3181
3198
Windows and an ` ENOTDIR` error on POSIX .
3182
3199
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 }` .
3188
3202
3189
3203
### ` fs.rm(path[, options], callback)`
3190
3204
<!-- YAML
@@ -4751,6 +4765,16 @@ See the POSIX rename(2) documentation for more details.
4751
4765
<!-- YAML
4752
4766
added: v0.1.21
4753
4767
changes:
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."
4754
4778
- version:
4755
4779
- v13.3.0
4756
4780
- v12.16.0
@@ -4778,8 +4802,8 @@ changes:
4778
4802
represents the number of retries. This option is ignored if the ` recursive`
4779
4803
option is not ` true ` . **Default:** ` 0 ` .
4780
4804
* ` 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** .
4783
4807
* ` retryDelay` {integer} The amount of time in milliseconds to wait between
4784
4808
retries. This option is ignored if the ` recursive` option is not ` true ` .
4785
4809
**Default:** ` 100 ` .
@@ -4789,11 +4813,8 @@ Synchronous rmdir(2). Returns `undefined`.
4789
4813
Using ` fs .rmdirSync ()` on a file (not a directory) results in an ` ENOENT ` error
4790
4814
on Windows and an ` ENOTDIR ` error on POSIX.
4791
4815
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 }` .
4797
4818
4798
4819
### ` fs .rmSync (path[, options])`
4799
4820
<!-- YAML
@@ -6641,6 +6662,8 @@ the file contents.
6641
6662
[` fs .readdirSync ()` ]: #fs_fs_readdirsync_path_options
6642
6663
[` fs .readv ()` ]: #fs_fs_readv_fd_buffers_position_callback
6643
6664
[` 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
6644
6667
[` fs .rmdir ()` ]: #fs_fs_rmdir_path_options_callback
6645
6668
[` fs .stat ()` ]: #fs_fs_stat_path_options_callback
6646
6669
[` fs .symlink ()` ]: #fs_fs_symlink_target_path_type_callback
@@ -6652,6 +6675,7 @@ the file contents.
6652
6675
[` fs .writev ()` ]: #fs_fs_writev_fd_buffers_position_callback
6653
6676
[` fsPromises .open ()` ]: #fs_fspromises_open_path_flags_mode
6654
6677
[` fsPromises .opendir ()` ]: #fs_fspromises_opendir_path_options
6678
+ [` fsPromises .rm ()` ]: #fs_fspromises_rm_path_options
6655
6679
[` fsPromises .utimes ()` ]: #fs_fspromises_utimes_path_atime_mtime
6656
6680
[` inotify (7 )` ]: https://man7.org/linux/man-pages/man7/inotify.7.html
6657
6681
[` kqueue (2 )` ]: https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
0 commit comments