Skip to content

Commit

Permalink
doc: clarify that fs.Dir async iterator closes automatically
Browse files Browse the repository at this point in the history
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #35148

PR-URL: #38438
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell committed Apr 27, 2021
1 parent fa6d084 commit 87aca07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/fs.md
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 87aca07

Please sign in to comment.