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 <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Michael Rommel authored and Rich Trott committed 2021-04-19 05:33:28 -07:00
1 parent 13d0de5954
commit 36decec87f
1 file changed
+1 -1
+1 -1
View File
@@ -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);