The current working directory in which to search. Defaults to process.cwd().
The place where patterns starting with / will be mounted onto. Defaults to path.resolve(options.cwd, "/") (/ on Unix systems, and C:\ or some such on Windows.)
Include .dot files in normal matches and globstar matches. Note that an explicit dot in a portion of the pattern will always match dot files.
By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid filesystem path is returned. Set this flag to disable that behavior.
Add a / character to directory matches. Note that this requires additional stat calls.
Don't sort the results.
Set to true to stat all results. This reduces performance somewhat, and is completely unnecessary, unless readdir is presumed to be an untrustworthy indicator of file existence.
When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. Set the silent option to true to suppress these warnings.
When an unusual error is encountered when attempting to read a directory, the process will just continue on in search of other matches. Set the strict option to raise an error in these cases.
See cache property above. Pass in a previously generated cache object to save some fs calls.
A cache of results of filesystem information, to prevent unnecessary stat calls. While it should not normally be necessary to set this, you may pass the statCache from one glob() call to the options object of another, if you know that the filesystem will not change between calls. (See "Race Conditions" below.)
A cache of known symbolic links. You may pass in a previously generated symlinks object to save lstat calls when resolving ** matches.
DEPRECATED: use glob.sync(pattern, opts) instead.
In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. By default, this implementation prevents duplicates in the result set. Set this flag to disable that behavior.
Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3).
Set to enable debug logging in minimatch and glob.
Do not expand {a,b} and {1..3} brace sets.
Do not match ** against multiple filenames. (Ie, treat it as a normal * instead.)
Do not match +(a|b) "extglob" patterns.
Perform a case-insensitive match. Note: on case-insensitive filesystems, non-magic patterns will match by default, since stat and readdir will not raise errors.
Perform a basename-only match if the pattern does not contain any slash characters. That is, *.js would be treated as equivalent to ** / *.js, matching all js files in all directories.
Do not match directories, only files. (Note: to match only directories, simply put a / at the end of the pattern.)
Add a pattern or an array of glob patterns to exclude matches. Note: ignore patterns are always in dot:true mode, regardless of any other settings.
Follow symlinked directories when expanding ** patterns. Note that this can result in a lot of duplicate references in the presence of cyclic links.
Set to true to call fs.realpath on all of the results. In the case of a symlink that cannot be resolved, the full absolute path to the matched entry is returned (though it will usually be a broken symlink)
Set to true to always receive absolute paths for matched files. Unlike realpath, this also affects the values returned in the match event.
Set to true to always receive absolute paths for matched files.
Set to true to always receive absolute paths for matched files. Unlike realpath, this also affects the values returned in the match event.
See cache property above.
See cache property above. Pass in a previously generated cache object to save some fs calls.
The current working directory in which to search.
The current working directory in which to search. Defaults to process.cwd().
Set to enable debug logging in minimatch and glob.
Include .dot files in normal matches and globstar matches.
Include .dot files in normal matches and globstar matches. Note that an explicit dot in a portion of the pattern will always match dot files.
Follow symlinked directories when expanding ** patterns.
Follow symlinked directories when expanding ** patterns. Note that this can result in a lot of duplicate references in the presence of cyclic links.
Add a pattern or an array of glob patterns to exclude matches.
Add a pattern or an array of glob patterns to exclude matches. Note: ignore patterns are always in dot:true mode, regardless of any other settings.
Add a / character to directory matches.
Add a / character to directory matches. Note that this requires additional stat calls.
Perform a basename-only match if the pattern does not contain any slash characters.
Perform a basename-only match if the pattern does not contain any slash characters. That is, *.js would be treated as equivalent to ** / *.js, matching all js files in all directories.
Do not expand {a,b} and {1..3} brace sets.
Perform a case-insensitive match.
Perform a case-insensitive match. Note: on case-insensitive filesystems, non-magic patterns will match by default, since stat and readdir will not raise errors.
Do not match directories, only files.
Do not match directories, only files. (Note: to match only directories, simply put a / at the end of the pattern.)
Do not match +(a|b) "extglob" patterns.
Do not match ** against multiple filenames.
Do not match ** against multiple filenames. (Ie, treat it as a normal * instead.)
By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid filesystem path is returned.
By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid filesystem path is returned. Set this flag to disable that behavior.
Set to never return an empty set, instead returning a set containing the pattern itself.
Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3).
Don't sort the results.
In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set.
In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. By default, this implementation prevents duplicates in the result set. Set this flag to disable that behavior.
Set to true to call fs.realpath on all of the results.
Set to true to call fs.realpath on all of the results. In the case of a symlink that cannot be resolved, the full absolute path to the matched entry is returned (though it will usually be a broken symlink)
The place where patterns starting with / will be mounted onto.
The place where patterns starting with / will be mounted onto. Defaults to path.resolve(options.cwd, "/") (/ on Unix systems, and C:\ or some such on Windows.)
When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr.
When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. Set the silent option to true to suppress these warnings.
Set to true to stat all results.
Set to true to stat all results. This reduces performance somewhat, and is completely unnecessary, unless readdir is presumed to be an untrustworthy indicator of file existence.
A cache of results of filesystem information, to prevent unnecessary stat calls.
A cache of results of filesystem information, to prevent unnecessary stat calls. While it should not normally be necessary to set this, you may pass the statCache from one glob() call to the options object of another, if you know that the filesystem will not change between calls. (See "Race Conditions" below.)
When an unusual error is encountered when attempting to read a directory, the process will just continue on in search of other matches.
When an unusual error is encountered when attempting to read a directory, the process will just continue on in search of other matches. Set the strict option to raise an error in these cases.
A cache of known symbolic links.
A cache of known symbolic links. You may pass in a previously generated symlinks object to save lstat calls when resolving ** matches.
DEPRECATED: use glob.sync(pattern, opts) instead.
Glob Options