Function listDirectory
- listDirectory(
basepath: string,
options?: {
allowMissing?: boolean;
mask?: string | RegExp;
recursive?: boolean;
skip?: string | RegExp;
},
): Promise<ListDirectoryEntry[]>Parameters
- basepath: string
Starting path. Can be absolute or relative to the current working directory. The returned fullPaths will be absolute, and the subPaths will be relative to this basepath
Optionaloptions: {
allowMissing?: boolean;
mask?: string | RegExp;
recursive?: boolean;
skip?: string | RegExp;
}OptionalallowMissing?: booleanIf true, a missing directory will be treated as an empty directory instead of throwing an error
Optionalmask?: string | RegExpIf set, only entries with a name matching the mask (string with wildcards or RegExp) will be returned
Optionalrecursive?: booleanIf true, subdirectories will be listed as well. The returned entries will have their subPath relative to the basepath
Optionalskip?: string | RegExpIf set, entries with a name matching the skip mask (string with wildcards or RegExp) will be ignored, and directories masking the name will not be recursed into
Returns Promise<ListDirectoryEntry[]>
An array of directory entries. Each entry has a name, type, fullPath, and subPath (relative to the basepath)
- basepath: string
List a directory, recursive