From 1eae4af6f712a15cc7530edc25dcf652790c8e83 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 27 Apr 2021 08:32:17 -0700 Subject: [PATCH] doc: clarify that fs.Dir async iterator closes automatically Signed-off-by: James M Snell Fixes: https://github.com/nodejs/node/issues/35148 PR-URL: https://github.com/nodejs/node/pull/38438 Reviewed-By: Antoine du Hamel Reviewed-By: Anna Henningsen --- doc/api/fs.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 179cabbfff5113..11e5b2c39fb785 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -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])`