OptionalabsoluteOptionalbaseIf set to true, then patterns without slashes will be matched against
the basename of the path if it contains slashes.
OptionalbraceEnables Bash-like brace expansion.
OptionalcaseEnables a case-sensitive mode for matching files.
OptionalconcurrencySpecifies the maximum number of concurrent requests from a reader to read directories.
Optional ReadonlycwdThe current working directory in which to search.
OptionaldeepSpecifies the maximum depth of a read directory relative to the start directory.
OptionaldotAllow patterns to match entries that begin with a period (.).
Optional ReadonlyexpandIf set to true, globby will automatically glob directories for you. If you define an Array it will only glob files that matches the patterns inside the Array. You can also define an Object with files and extensions like in the example below.
Note that if you set this option to false, you won't get back matched directories unless you set onlyFiles: false.
OptionalextglobEnables Bash-like extglob functionality.
OptionalfollowIndicates whether to traverse descendants of symbolic link directories.
OptionalfsCustom implementation of methods for working with the file system.
Optional ReadonlygitignoreRespect ignore patterns in .gitignore files that apply to the globbed files.
When enabled, globby searches for .gitignore files from the current working directory downward, and if a Git repository is detected (by finding a .git directory), it also respects .gitignore files in parent directories up to the repository root. This matches Git's actual behavior where patterns from parent .gitignore files apply to subdirectories.
Gitignore patterns take priority over user patterns, matching Git's behavior. To include gitignored files, set this to false.
Performance: Globby reads .gitignore files before globbing. When there are no negation patterns (like !important.log) and no parent .gitignore files are found, it passes ignore patterns to fast-glob to skip traversing ignored directories entirely, which significantly improves performance for large node_modules or build directories. When negation patterns or parent .gitignore files are present, all filtering is done after traversal to ensure correct Git-compatible behavior. For optimal performance, prefer specific .gitignore patterns without negations, or use ignoreFiles: '.gitignore' to target only the root ignore file.
OptionalglobstarEnables recursively repeats a pattern containing **.
If false, ** behaves exactly like *.
OptionalignoreAn array of glob patterns to exclude matches. This is an alternative way to use negative patterns.
Optional ReadonlyignoreGlob patterns to look for ignore files, which are then used to ignore globbed files.
This is a more generic form of the gitignore option, allowing you to find ignore files with a compatible syntax. For instance, this works with Babel's .babelignore, Prettier's .prettierignore, or ESLint's .eslintignore files.
Performance tip: Using a specific path like '.gitignore' is much faster than recursive patterns.
OptionalmarkMark the directory path with the final slash.
OptionalmatcherOptionalobjectReturns objects (instead of strings) describing entries.
OptionalonlyReturn only directories.
OptionalonlyReturn only files.
OptionalstatsEnables an object mode (objectMode) with an additional stats field.
OptionalsuppressBy default this package suppress only ENOENT errors.
Set to true to suppress any error.
OptionalthrowThrow an error when symbolic link is broken if true or safely
return lstat call if false.
OptionaluniqueEnsures that the returned entries are unique.
Return the absolute path for entries.