listDir
Lists the contents of a directory.
- import the method
import { listDir } from "nodelpers";
- params
path: string;
options: TListDirOptions;
TListDirOptions = { dirsOnly?: boolean; filesOnly?: boolean };
- usage
let path = "/path/to/dir";
listDir(path);
listDir(path, { dirsOnly: true });
listDir(path, { filesOnly: true });