function Deno.readDir
Jump to headingreadDir(path: string | URL): AsyncIterable<DirEntry>
Reads the directory given by path
and returns an async iterable of
Deno.DirEntry
. The order of entries is not guaranteed.
for await (const dirEntry of Deno.readDir("/")) {
console.log(dirEntry.name);
}
Throws error if path
is not a directory.
Requires allow-read
permission.
Parameters Jump to heading
Jump to headingpath: string | URL
Return Type Jump to heading
AsyncIterable<DirEntry>