summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro <AlvaroBernalG@users.noreply.github.com>2019-05-01 22:45:30 +0100
committerRyan Dahl <ry@tinyclouds.org>2019-05-01 17:45:30 -0400
commit2f14376f604fec4b7a4bded11c9f0578bad39a6b (patch)
tree12a1b2801057c4f027a8d8540dc54b895150ff84
parent80161217d38acd76cd09f40e40986cc4a90e14ac (diff)
docs(fs): fix async iterator (denoland/deno_std#366)
Original: https://github.com/denoland/deno_std/commit/aa9446390230da43d5ac6dcdcf8c355e1deedb12
-rw-r--r--fs/README.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/README.md b/fs/README.md
index 3acf757a8..01780892d 100644
--- a/fs/README.md
+++ b/fs/README.md
@@ -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