fast-glob
Extremely fast glob library for Node.js. fast-glob provides filesystem pattern matching (*.ts, src/**/*.test.js, !node_modules/**) with Promise and stream-based APIs. Up to 3-8x faster than competing glob libraries by using micromatch for pattern matching and walking the filesystem efficiently. Used by Vite, Vitest, ESLint, and many build tools that need fast file discovery.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Local filesystem library — no network calls. Path traversal risks if patterns include user-supplied input — validate and sanitize glob patterns before use in agent file operations.
⚡ Reliability
Best When
You need fast filesystem file discovery with glob patterns in a Node.js agent tool — fast-glob's performance makes it the standard choice for build tools and code analysis pipelines.
Avoid When
You need real-time file watching (use chokidar) or you're matching patterns against strings without filesystem traversal (use micromatch).
Use Cases
- • Discover agent source files matching patterns — find all Python files, exclude test directories, collect configs for processing
- • Build file manifest lists for agent code analysis pipelines — collect all TypeScript files in src/, excluding vendor directories
- • Stream large file sets for agent processing without loading all paths into memory — use fast-glob stream mode for large codebases
- • Generate dynamic import lists or watch file lists for agent development tools based on glob patterns
- • Implement project-wide search for agent code intelligence tools — find all files matching code patterns across directories
Not For
- • Simple string glob matching without filesystem traversal — use micromatch or picomatch for pattern testing without filesystem access
- • Real-time file watching — use chokidar for watching file system changes; fast-glob is one-time scan
- • Applications where glob is not the bottleneck — for simple patterns on small directories, the built-in glob module may be sufficient
Interface
Authentication
Local filesystem library — no external auth or network calls.
Pricing
MIT-licensed open source npm package.
Agent Metadata
Known Gotchas
- ⚠ Negation patterns (!**/node_modules/**) must be in the patterns array, not as a separate parameter — placing negation in the wrong location causes it to be treated as an affirmative pattern
- ⚠ fast-glob always returns forward-slash paths on all platforms (including Windows) — normalize paths with path.sep when comparing with os.path utilities in cross-platform agent code
- ⚠ Braces {a,b} in patterns are expanded before matching — avoid braces in file paths passed as arguments; escape them or use multiple patterns instead
- ⚠ The onlyFiles option (default: true) excludes directories — pass onlyDirectories: true or onlyFiles: false when agent needs to include directory paths in results
- ⚠ Symlinks to directories are followed by default — use followSymbolicLinks: false to prevent following symlinks that could cause infinite recursion in circular symlink setups
- ⚠ Pattern with absolute paths must use forward slashes — on Windows, C:\path\to\file must be C:/path/to/file in fast-glob patterns; use pathToFileURL for safe cross-platform path handling
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for fast-glob.
Scores are editorial opinions as of 2026-03-06.