How can Deno.readDir be promisified? #13258
-
In all my code, I don't use async functions. Now, to perform a directory search, I need to use async and Promise doesn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is done so that you can list large directories efficiently. |
Beta Was this translation helpful? Give feedback.
-
Thanks, Luca, |
Beta Was this translation helpful? Give feedback.
Deno.readDir
returns an async iterator. This is very much like a promise, except that it can return more than one value.This is done so that you can list large directories efficiently.