From 7a92c3cfd4614685426fc6cdff77e54f95895631 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 788102d1ec795e..945ab5a2bf0edc 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -905,6 +905,9 @@ try { } ``` +When using the async iterator, the {fs.Dir} object will be automatically +closed after the iterator exits. + ### `fsPromises.readdir(path[, options])`