glob

The classic and most widely used glob pattern matching library for Node.js. Finds files using glob patterns (*, **, ?, {a,b}, etc.) and returns matching file paths. Glob v10 is a complete rewrite with ESM-first support, async iterators, and modern API. Powers npm, webpack, Jest, ESLint, and most build tools that need file discovery. Also available as a CLI command.

Evaluated Mar 06, 2026 (0d ago) v10.x
Homepage ↗ Repo ↗ Developer Tools glob file-matching pattern node cli filesystem typescript esm
⚙ Agent Friendliness
68
/ 100
Can an agent use this?
🔒 Security
96
/ 100
Is it safe for agents?
⚡ Reliability
87
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
82
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
90
Secret Handling
90

Filesystem access library — runs with process permissions. Path traversal risk if patterns include user-controlled input (e.g., '../../../etc/passwd' via **). Sanitize glob patterns from untrusted input.

⚡ Reliability

Uptime/SLA
95
Version Stability
85
Breaking Changes
78
Error Recovery
90
AF Security Reliability

Best When

You need to find files on disk matching glob patterns in Node.js build tools, test runners, or file processing scripts.

Avoid When

You need in-memory pattern matching without filesystem access (use micromatch), or are watching for file changes (use chokidar).

Use Cases

  • Find all TypeScript files in a project: glob('src/**/*.ts') for build system integration
  • Discover test files matching patterns for test runner configuration: glob('**/*.test.{js,ts}')
  • List files matching patterns in deployment scripts: copy all HTML files, exclude node_modules
  • Implement file watchers by first discovering existing files then combining with chokidar for new files
  • Process all files of a specific type in batch operations: glob('data/**/*.json') for data processing

Not For

  • In-memory pattern matching without filesystem — use micromatch or picomatch for string pattern matching without file I/O
  • File watching (change events) — use chokidar for watching file changes; glob is for static discovery
  • Very simple patterns in Node.js 22+ — native fs.glob() is now built-in for basic use cases

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — filesystem utility library.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Fully free, ISC licensed.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • glob v10 is ESM-only — use glob v9 or fast-glob for CommonJS projects; breaking change from v7/v8 which supported CJS
  • ** pattern matches zero or more path segments — 'src/**/*.ts' matches 'src/foo.ts' AND 'src/a/b/foo.ts'; verify patterns match expected depth
  • Patterns use forward slashes even on Windows — glob normalizes paths; don't mix OS-native backslashes in patterns
  • No matches returns empty array — glob never throws for no matches; check array length to distinguish 'pattern found nothing' from errors
  • Negation patterns: pass ignore option for exclusions — glob('**/*.js', { ignore: ['**/node_modules/**'] }); negation syntax (!) is supported in v10
  • Symlinks: glob follows symlinks by default — use follow: false to not follow symlinks if you have circular symlink structures that could cause infinite traversal

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for glob.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered