Skip to content

Commit 1eae4af

Browse files
jasnelltargos
authored andcommitted
doc: clarify that fs.Dir async iterator closes automatically
Signed-off-by: James M Snell <[email protected]> Fixes: #35148 PR-URL: #38438 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 195f679 commit 1eae4af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/fs.md

+6
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,9 @@ try {
901901
}
902902
```
903903
904+
When using the async iterator, the {fs.Dir} object will be automatically
905+
closed after the iterator exits.
906+
904907
### `fsPromises.readdir(path[, options])`
905908
<!-- YAML
906909
added: v10.0.0
@@ -5119,6 +5122,9 @@ try {
51195122
}
51205123
```
51215124
5125+
When using the async iterator, the {fs.Dir} object will be automatically
5126+
closed after the iterator exits.
5127+
51225128
#### `dir.close()`
51235129
<!-- YAML
51245130
added: v12.12.0

0 commit comments

Comments
 (0)