Optionaloptions: stringasync version of filter scan dir
async version of filter scan dir
async version of filter scan dir
async version of filter scan dir
Optionalconcurrency?: numberfor async version only - maximum directories reading entries or metadata concurrently.
Default: 50. Ancestors waiting for child directories do not consume a slot.
0 or 1 to disable concurrent modeNOTE: setting this to a very large number, or Infinity, could potentially
increase performance very significantly, however, there is a dimishing return
and more memory usage, so the default is already fairly good.
Optionalcwd?: stringcurrent working directory to start scanning
Optionalfilter?: FilterCallback<Stats>callback to filter files.
OptionalfilterDir?: FilterCallback<Stats>callback to filter directories.
OptionalfilterExt?: string | string[]array or string of extensions to include only, apply after ignoreExt
OptionalfullStat?: trueuse fs.lstat to get stat of each file, instead of readir's withFileTypes option.
true - for significant performance improvement, set this to falseOptionalgitignore?: GitignoreParserparse ancestor repository and nested .gitignore rules; disabled when omitted
OptionalignoreDirs?: string | string[]directory basenames to skip at every depth, before reading metadata or children
OptionalignoreExt?: string | string[]array or string of extensions to ignore. ext must include ., ie: ".js"
OptionalincludeDir?: booleaninclude directories in result
OptionalincludeSymlink?: booleaninclude symlinks in result. When includeDir is false, all symlinks are skipped unless
this is true, links to files as well as links to directories. When includeDir is true,
this option has no effect and symlinks go through the normal filters. Symlinks are never followed.
OptionalmaxLevel?: numberzero base max level of directories to recurse into. Default: Infinity
OptionalpathSep?: stringpath separator to use to join entries in output paths.
Filesystem calls always use /.
path.posix.sepcwd is automatically converted to use /.Optionalprefilter?: (file: string, path: string, entry: Dirent) => booleansynchronous entry filter before lstat; returning false also prunes directories. Requires fullStat to be true (the default). Throws when fullStat is false.
Optionalprefix?: stringprefix to add to the paths to scan. It's applied after cwd.
prefix will be in the resulting paths. Useful if you want
to scan a dir further down from cwd but you don't want to prepend
CWD to the resulting paths.OptionalprependCwd?: booleanprepend CWD to paths returned
OptionalrethrowError?: booleanset to true to throw errors instead of ignoring them
OptionalsortFiles?: booleansort files from each dir
async version of filter scan dir
Optionaloptions: {Optionalconcurrency?: numberfor async version only - maximum directories reading entries or metadata concurrently.
Default: 50. Ancestors waiting for child directories do not consume a slot.
0 or 1 to disable concurrent modeNOTE: setting this to a very large number, or Infinity, could potentially
increase performance very significantly, however, there is a dimishing return
and more memory usage, so the default is already fairly good.
Optionalcwd?: stringcurrent working directory to start scanning
Optionalfilter?: FilterCallback<Dirent<string> | Stats>callback to filter files.
OptionalfilterDir?: FilterCallback<Dirent<string> | Stats>callback to filter directories.
OptionalfilterExt?: string | string[]array or string of extensions to include only, apply after ignoreExt
OptionalfullStat?: booleanuse fs.lstat to get stat of each file, instead of readir's withFileTypes option.
true - for significant performance improvement, set this to falseOptionalgitignore?: GitignoreParserparse ancestor repository and nested .gitignore rules; disabled when omitted
OptionalignoreDirs?: string | string[]directory basenames to skip at every depth, before reading metadata or children
OptionalignoreExt?: string | string[]array or string of extensions to ignore. ext must include ., ie: ".js"
OptionalincludeDir?: booleaninclude directories in result
OptionalincludeSymlink?: booleaninclude symlinks in result. When includeDir is false, all symlinks are skipped unless
this is true, links to files as well as links to directories. When includeDir is true,
this option has no effect and symlinks go through the normal filters. Symlinks are never followed.
OptionalmaxLevel?: numberzero base max level of directories to recurse into. Default: Infinity
OptionalpathSep?: stringpath separator to use to join entries in output paths.
Filesystem calls always use /.
path.posix.sepcwd is automatically converted to use /.Optionalprefilter?: (file: string, path: string, entry: Dirent) => booleansynchronous entry filter before lstat; returning false also prunes directories. Requires fullStat to be true (the default). Throws when fullStat is false.
Optionalprefix?: stringprefix to add to the paths to scan. It's applied after cwd.
prefix will be in the resulting paths. Useful if you want
to scan a dir further down from cwd but you don't want to prepend
CWD to the resulting paths.OptionalprependCwd?: booleanprepend CWD to paths returned
OptionalrethrowError?: booleanset to true to throw errors instead of ignoring them
OptionalsortFiles?: booleansort files from each dir
async version of filter scan dir