Skip to main content
Version: Next

readDirSync

function readDirSync(path): Iterable<DirEntry>;

Sync version of readDir.

Parameters​

ParameterTypeDescription

path

string

Directory path to read.

Returns​

Iterable<DirEntry>

Iterator.

Throws​

Throws TypeError if the path is invalid. Or throws Error if failed to read the directory.

Example​

for (const entry of Rsvim.fs.readDirSync(".")) {
Rsvim.cmd.echo(entry.name);
}