summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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