Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/levo/templates/new-project/lib/lib.deno_runtime.d.ts>Deno.readDirSync

Server side rendering with The Elm Architecture in Deno
Latest
function Deno.readDirSync
import { Deno } from "https://deno.land/x/levo@v0.0.27/templates/new-project/lib/lib.deno_runtime.d.ts";
const { readDirSync } = Deno;

Synchronously reads the directory given by path and returns an iterable of Deno.DirEntry.

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

Throws error if path is not a directory.

Requires allow-read permission.

Parameters

path: string | URL

Returns

Iterable<DirEntry>