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: nodejs#35148
  • Loading branch information
jasnell committed Apr 27, 2021
1 parent bbe24e2 commit f17a968
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
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 All @@ -5132,6 +5138,9 @@ Subsequent reads will result in errors.
A promise is returned that will be resolved after the resource has been
closed.
When using the async iterator, the {fs.Dir} object will be automatically
closed after the iterator exits.
#### `dir.close(callback)`
<!-- YAML
added: v12.12.0
Expand Down

0 comments on commit f17a968

Please sign in to comment.