Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.readDir

Reads the directory given by path and returns an async iterable of Deno.DirEntry.

for await (const dirEntry of Deno.readDir("/")) {
  console.log(dirEntry.name);
}

Throws error if path is not a directory.

Requires allow-read permission.

function readDir(path: string | URL): AsyncIterable<DirEntry>;
§
readDir(path: string | URL): AsyncIterable<DirEntry>
[src]

§Parameters

§
path: string | URL
[src]

§Return Type

§
AsyncIterable<DirEntry>
[src]