Skip to content

Commit 6b4b70d

Browse files
committed
edited
1 parent 1b59126 commit 6b4b70d

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

doc/api/fs.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,9 @@ a colon, Node.js will open a file system stream, as described by
12201220
<!-- YAML
12211221
added: v12.12.0
12221222
changes:
1223+
- version: REPLACEME
1224+
pr-url: https://github.com/nodejs/node/pull/41439
1225+
description: Added `recursive` option.
12231226
- version:
12241227
- v13.1.0
12251228
- v12.16.0
@@ -1233,6 +1236,8 @@ changes:
12331236
* `bufferSize` {number} Number of directory entries that are buffered
12341237
internally when reading from the directory. Higher values lead to better
12351238
performance but higher memory usage. **Default:** `32`
1239+
* `recursive` {boolean} Resolved `Dir` will be an {AsyncIterable}
1240+
containing all sub files and directories. **Default:** `false`
12361241
* Returns: {Promise} Fulfills with an {fs.Dir}.
12371242
12381243
Asynchronously open a directory for iterative scanning. See the POSIX
@@ -1266,6 +1271,9 @@ closed after the iterator exits.
12661271
<!-- YAML
12671272
added: v10.0.0
12681273
changes:
1274+
- version: REPLACEME
1275+
pr-url: https://github.com/nodejs/node/pull/41439
1276+
description: Added `recursive` option.
12691277
- version: v10.11.0
12701278
pr-url: https://github.com/nodejs/node/pull/22020
12711279
description: New option `withFileTypes` was added.
@@ -1275,6 +1283,7 @@ changes:
12751283
* `options` {string|Object}
12761284
* `encoding` {string} **Default:** `'utf8'`
12771285
* `withFileTypes` {boolean} **Default:** `false`
1286+
* `recursive` {boolean} **Default:** `false`
12781287
* Returns: {Promise} Fulfills with an array of the names of the files in
12791288
the directory excluding `'.'` and `'..'`.
12801289
@@ -3402,6 +3411,9 @@ const { openAsBlob } = require('node:fs');
34023411
<!-- YAML
34033412
added: v12.12.0
34043413
changes:
3414+
- version: REPLACEME
3415+
pr-url: https://github.com/nodejs/node/pull/41439
3416+
description: Added `recursive` option.
34053417
- version: v18.0.0
34063418
pr-url: https://github.com/nodejs/node/pull/41678
34073419
description: Passing an invalid callback to the `callback` argument
@@ -3420,6 +3432,7 @@ changes:
34203432
* `bufferSize` {number} Number of directory entries that are buffered
34213433
internally when reading from the directory. Higher values lead to better
34223434
performance but higher memory usage. **Default:** `32`
3435+
* `recursive` {boolean} **Default:** `false`
34233436
* `callback` {Function}
34243437
* `err` {Error}
34253438
* `dir` {fs.Dir}
@@ -3538,6 +3551,9 @@ above values.
35383551
<!-- YAML
35393552
added: v0.1.8
35403553
changes:
3554+
- version: REPLACEME
3555+
pr-url: https://github.com/nodejs/node/pull/41439
3556+
description: Added `recursive` option.
35413557
- version: v18.0.0
35423558
pr-url: https://github.com/nodejs/node/pull/41678
35433559
description: Passing an invalid callback to the `callback` argument
@@ -3567,6 +3583,7 @@ changes:
35673583
* `options` {string|Object}
35683584
* `encoding` {string} **Default:** `'utf8'`
35693585
* `withFileTypes` {boolean} **Default:** `false`
3586+
* `recursive` {boolean} **Default:** `false`
35703587
* `callback` {Function}
35713588
* `err` {Error}
35723589
* `files` {string\[]|Buffer\[]|fs.Dirent\[]}
@@ -4109,9 +4126,9 @@ Asynchronous stat(2). The callback gets two arguments `(err, stats)` where
41094126

41104127
In case of an error, the `err.code` will be one of [Common System Errors][].
41114128

4112-
[`fs.stat()`][] follows symbolic links, [`fs.lstat`][] looks at the links themselves.
4113-
Therefore, it is recommended to use fs.lstat when the links themselves
4114-
need to be examined.
4129+
[`fs.stat()`][] follows symbolic links, [`fs.lstat()`][] looks at the links
4130+
themselves. Therefore, it is recommended to use [`fs.lstat()`][] when the links
4131+
themselves need to be examined.
41154132

41164133
Using `fs.stat()` to check for the existence of a file before calling
41174134
`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended.
@@ -5547,6 +5564,9 @@ object with an `encoding` property specifying the character encoding to use.
55475564
<!-- YAML
55485565
added: v12.12.0
55495566
changes:
5567+
- version: REPLACEME
5568+
pr-url: https://github.com/nodejs/node/pull/41439
5569+
description: Added `recursive` option.
55505570
- version:
55515571
- v13.1.0
55525572
- v12.16.0
@@ -5560,6 +5580,7 @@ changes:
55605580
* `bufferSize` {number} Number of directory entries that are buffered
55615581
internally when reading from the directory. Higher values lead to better
55625582
performance but higher memory usage. **Default:** `32`
5583+
* `recursive` {boolean} **Default:** `false`
55635584
* Returns: {fs.Dir}
55645585
55655586
Synchronously open a directory. See opendir(3).
@@ -5603,6 +5624,9 @@ this API: [`fs.open()`][].
56035624
<!-- YAML
56045625
added: v0.1.21
56055626
changes:
5627+
- version: REPLACEME
5628+
pr-url: https://github.com/nodejs/node/pull/41439
5629+
description: Added `recursive` option.
56065630
- version: v10.10.0
56075631
pr-url: https://github.com/nodejs/node/pull/22020
56085632
description: New option `withFileTypes` was added.
@@ -5616,6 +5640,7 @@ changes:
56165640
* `options` {string|Object}
56175641
* `encoding` {string} **Default:** `'utf8'`
56185642
* `withFileTypes` {boolean} **Default:** `false`
5643+
* `recursive` {boolean} **Default:** `false`
56195644
* Returns: {string\[]|Buffer\[]|fs.Dirent\[]}
56205645
56215646
Reads the contents of the directory.
@@ -6469,6 +6494,16 @@ The file name that this {fs.Dirent} object refers to. The type of this
64696494
value is determined by the `options.encoding` passed to [`fs.readdir()`][] or
64706495
[`fs.readdirSync()`][].
64716496
6497+
#### `dirent.path`
6498+
6499+
<!-- YAML
6500+
added: REPLACEME
6501+
-->
6502+
6503+
* {string}
6504+
6505+
The base path that this {fs.Dirent} object refers to.
6506+
64726507
### Class: `fs.FSWatcher`
64736508
64746509
<!-- YAML

0 commit comments

Comments
 (0)