From b8198484870708ab2bfc4736a3668c71acaf3c61 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 384e4b0a2eb02d..788102d1ec795e 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -936,7 +936,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);