path to file without cwd: path + file
extsion of the file, ie: .js
name of the file being considered
full path with cwd + path + file
file name without the extension
path to the directory being processed that contains the file
result from fs.lstat or readdir
filter callback for file or directory entry
name of the file/dir being considered
path to the directory containing the file. Not the full path, just the relative path from CWD. It's empty string for the files in the first level directory.
extras data
Info from the filter callback to indicate what to do next
if not undefined
, then use this as the value to add to the output
name of the group to add the file or directory (if grouping is enabled)
if true
then skip the file or directory, else add it
stop the scanning and return the result immediately.
result from the filter callback
false
or undefined
- skip the file or directorytrue
- include the file in the default resultoptions specifically to set grouping flag true
to enable grouping of files
The scanned result if grouping is enabled.
files
group will contain all files not assigned a groupOptions for filterScanDir
for async version only - numer of directories to process concurrently. Default: 50
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.
current working directory to start scanning
callback to filter files.
callback to filter directories.
array or string of extensions to include only, apply after ignoreExt
use fs.lstat
to get stat of each file, instead of readir
's withFileTypes
option.
true
- for significant performance improvement, set this to false
array or string of extensions to ignore. ext must include .
, ie: ".js"
include directories in result
zero base max level of directories to recurse into. Default: Infinity
path separator to use to join entries
path.posix.sep
cwd
is automatically converted to use /
.prefix 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.prepend CWD to paths returned
set to true
to throw errors instead of ignoring them
sort files from each dir
async version of filter scan dir
sync version of filter scan dir
Generated using TypeDoc
type of the 3rd argument for the filter callback