From 36decec87f7b942146d13cdca7c609dfdb9f847d Mon Sep 17 00:00:00 2001 From: Michael Rommel Date: Mon, 19 Apr 2021 12:03:51 +0200 Subject: [PATCH] doc: remove superfluous await from fsPromises.readdir example The `await` operator in the example, iterating over the returned array of filenames is not necessary, since the returned array is either consisting of `string`s or of `fs.Dirent` objects, neither providing an asyncIterator. Refs: https://github.com/nodejs/help/issues/3317 PR-URL: https://github.com/nodejs/node/pull/38293 Reviewed-By: Antoine du Hamel Reviewed-By: Rich Trott Reviewed-By: Benjamin Gruenbaum --- doc/api/fs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 0cabd57120e424..0a39adb2d85c1b 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -932,7 +932,7 @@ import { readdir } from 'fs/promises'; try { const files = await readdir(path); - for await (const file of files) + for (const file of files) console.log(file); } catch (err) { console.error(err);