A user-friendly glob matching library for Node.js with promise API, negation patterns, and .gitignore support.
Globby is a Node.js library for matching file paths using glob patterns. It extends fast-glob with additional features like promise-based APIs, negation patterns, automatic directory expansion, and support for .gitignore files. It solves the problem of complex file system pattern matching in build tools, scripts, and applications.
Node.js developers building CLI tools, build scripts, or applications that need to match files using patterns, especially those who want a more user-friendly interface than raw fast-glob.
Developers choose Globby because it wraps fast-glob's performance with a more intuitive API, adding features like negation-only patterns, ignore file support, and automatic directory expansion that reduce boilerplate and common pitfalls.
User-friendly glob matching
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides modern async/await support out of the box, making it easy to integrate into asynchronous Node.js workflows without callbacks, as shown in the usage examples.
Automatically respects .gitignore, .eslintignore, and similar files with options like gitignore and ignoreFiles, simplifying project-specific file exclusion without manual configuration.
Supports multiple patterns, negated patterns, and automatic directory expansion (expandDirectories), reducing boilerplate code for complex inclusion/exclusion scenarios.
Includes globbyStream for handling large file sets incrementally, preventing memory issues when processing extensive directories, as documented in the API section.
Patterns with backslashes fail silently on Windows unless developers use path.posix.join() or convertPathToPattern(), adding complexity and potential errors in cross-platform projects.
When using gitignore with negation patterns or parent .gitignore files, globby performs filtering after traversal instead of during, which can significantly slow down operations on large directories, as noted in the performance tips.
As a wrapper, globby inherits any limitations or bugs from fast-glob, and updates or fixes may be delayed until the underlying library is updated, introducing potential vendor lock-in.