Glob matching for Node.js with negated patterns, directory expansion and .gitignore support
open sourceMITfree
globby is Sindre Sorhus's Node.js library for matching files with glob patterns, built on fast-glob. It takes several patterns at once, negated and negation-only patterns, expands a directory into everything under it, and respects .gitignore files the way Git does (including parent ones up to the repository root, and the global gitignore), or any ignore file with the same syntax such as .prettierignore. It has promise, sync and stream APIs and accepts a URL as the working directory.
Problems it solves
- find files matching glob patterns in my Node.js script while skipping what .gitignore ignores
- match files with several patterns and exclusions in one call in Node
- list files in a directory tree without walking node_modules
Features
- multiple and negated glob patterns
- directory expansion
- .gitignore and other ignore files, as Git applies them
- promise, sync and stream APIs
Limitations
Alternatives
The same job
These do what globby does.
