mirror of
https://github.com/denoland/deno.git
synced 2025-01-13 17:39:18 -05:00
docs(fs): fix async iterator (#366)
This commit is contained in:
parent
b6aaddbcc0
commit
aa94463902
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue