readDir
function readDir(path): AsyncIterable<DirEntry>;
Read a directory with async iterator.
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| Directory path to read. |
Returns
AsyncIterable<DirEntry>
Async iterator.
Throws
Throws TypeError if the path is invalid. Or throws Error if failed to read the directory.
Example
for await (const entry of Rsvim.fs.readDir(".")) {
Rsvim.cmd.echo(entry.name);
}