Skip to content

Commit b819848

Browse files
michaelrommeltargos
authored andcommitted
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: nodejs/help#3317 PR-URL: #38293 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 9fa7dcf commit b819848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ import { readdir } from 'fs/promises';
936936
937937
try {
938938
const files = await readdir(path);
939-
for await (const file of files)
939+
for (const file of files)
940940
console.log(file);
941941
} catch (err) {
942942
console.error(err);

0 commit comments

Comments
 (0)