UNPKG

readdir

Version:

Reads a directory and return results with the ability to use Ant style file match patterns

19 lines (18 loc) 948 B
import { FileStatFn } from './file-stat'; /** * Given the name of the directory about to be traversed, checks whether it should be - allows for the automatic * removal of "hidden" directories. * * @param {String} base * @param {String} directoryName * @param {Number} options * @return {Boolean} */ export declare function should_read_directory(base: string, directoryName: string, options: number): boolean; /** * Reads the supplied directory path and builds an array of files within the directory. This will work recursively * on each sub directory found. The optional appendTo argument can be used to merge file paths onto an existing * array, and is used internally for recursion. */ export declare function read_dir_sync(dir: string, appendTo: string[], prefixLength: number, options: number): string[]; export declare function read_dir(dir: string, prefixLength: number, options: number, fileStat: FileStatFn): Promise<string[]>;