Ende.readDirSync

function ยท requires --allow-read

function Ende.readDirSync(path: string | URL): IteratorObject<DirEntry>

Synchronously reads the directory given by path and returns an iterable of Ende.DirEntry. The order of entries is not guaranteed.

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

Throws error if path is not a directory.

Requires allow-read permission.