doc: clarify that fs.Dir async iterator closes automatically

Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: https://github.com/nodejs/node/issues/35148

PR-URL: https://github.com/nodejs/node/pull/38438
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
James M Snell authored and Michaël Zasso committed 2021-04-29 13:45:40 +02:00
1 parent 195f679331
commit 1eae4af6f7
1 file changed
+6
+6
View File
@@ -901,6 +901,9 @@ try {
}
```
When using the async iterator, the {fs.Dir} object will be automatically
closed after the iterator exits.
### `fsPromises.readdir(path[, options])`
<!-- YAML
added: v10.0.0
@@ -5119,6 +5122,9 @@ try {
}
```
When using the async iterator, the {fs.Dir} object will be automatically
closed after the iterator exits.
#### `dir.close()`
<!-- YAML
added: v12.12.0