Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/lib.deno.d.ts>Deno.readDir

A JavaScript extension package for building strong and modern applications.
Latest
function Deno.readDir
allow-read
import { Deno } from "https://deno.land/x/ayonli_jsext@v0.9.72/lib.deno.d.ts";
const { readDir } = Deno;

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

path: string | URL

Returns

AsyncIterable<DirEntry>