readDir method

AsyncIterable<DirEntry> readDir(
  1. Object path
)

Reads the directory given by path and returns an async iterable of {@linkcode 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.

Implementation

_i10.AsyncIterable<_i4.DirEntry> readDir(_i2.Object path) => _i3.callMethod(
      this,
      'readDir',
      [path],
    );