Skip to content

Commit

Permalink
docs(fs): fix async iterator (denoland#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroBernalG authored and ry committed May 1, 2019
1 parent b6aaddb commit aa94463
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,13 @@ for (const fileInfo of walkSync()) {
}

// Async
for (const fileInfo of walk()) {
console.log(fileInfo.path);
async function printFilesPath() {
for await (const fileInfo of walk()) {
console.log(fileInfo.path);
}
}

printFilesPath().then(() => console.log("Done!"));
```

### writeJson
Expand Down

0 comments on commit aa94463

Please sign in to comment.