readDirSync
import { readDirSync } from "jsr:@ende/fs/unstable-read-dir";function · experimental · requires --allow-read
function* readDirSync(path: string | URL): Iterable<DirEntry>Synchronously reads the directory given by path and returns an iterable
of DirEntry. The order of entries is not guaranteed.
Throws Error if path is not a directory.
Requires allow-read permission.
path: string | URLThe path to the directory to read.
Returns
An iterable of DirEntry.
Example: Usage
import { readDirSync } from "@ende/fs/unstable-read-dir";
for (const dirEntry of readDirSync("/")) {
console.log(dirEntry.name);
}