Reads the contents of a directory at the specified path.
The path of the directory to read.
Optional
Options of readdir.
A promise that resolves to an AsyncIOResult containing an async iterable iterator over the entries of the directory.
AsyncIOResult
1.0.0
readDirSync for synchronous version
// List directory contents(await readDir('/documents')) .inspect(async entries => { for await (const entry of entries) { console.log(entry.path, entry.handle.kind); } });// List recursivelyawait readDir('/documents', { recursive: true }); Copy
// List directory contents(await readDir('/documents')) .inspect(async entries => { for await (const entry of entries) { console.log(entry.path, entry.handle.kind); } });// List recursivelyawait readDir('/documents', { recursive: true });
Reads the contents of a directory at the specified path.