micromatch

Fast glob pattern matching library for JavaScript using bash-like wildcard patterns. Supports extglob patterns, brace expansion, character classes, negation patterns, and POSIX-style character classes. Used internally by webpack, Jest, ESLint, and dozens of other major tools for file filtering. More feature-rich and faster than minimatch for most use cases.

Evaluated Mar 06, 2026 (0d ago) v4.x
Homepage ↗ Repo ↗ Developer Tools glob pattern-matching micromatch wildcard file filter fnmatch extglob
⚙ Agent Friendliness
67
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
91
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

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

🔒 Security

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

Pure local computation — no network, no credentials. ReDoS-resistant via picomatch's efficient regex compilation. MIT licensed. No data leaves the process.

⚡ Reliability

Uptime/SLA
100
Version Stability
92
Breaking Changes
88
Error Recovery
85
AF Security Reliability

Best When

You need to filter or match file paths against glob patterns in-memory without filesystem I/O — common in build tools, config systems, and file pipeline processors.

Avoid When

You need to discover files from the filesystem — use fast-glob or globby which use micromatch internally with filesystem traversal.

Use Cases

  • Filter file arrays against glob patterns for build tools, linters, and test runners without filesystem traversal
  • Match file paths against include/exclude lists in agent tool configuration systems
  • Validate that generated file paths match expected patterns during agent code generation pipelines
  • Implement glob-based routing or file categorization for agent file system operations
  • Build efficient ignore lists by matching paths against negation patterns (e.g., '!node_modules/**')

Not For

  • Filesystem traversal — micromatch only matches strings, use glob or fast-glob for actual file discovery
  • Regular expression patterns — use the native RegExp API for regex-based matching
  • Cross-platform path normalization — explicitly convert backslashes to forward slashes before matching on Windows

Interface

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

Authentication

Methods: none
OAuth: No Scopes: No

Local npm library — no authentication required.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed open source library. Zero cost.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Windows backslash paths must be converted to forward slashes before matching — micromatch only handles POSIX-style paths (use path.normalize or replace /\\/g, '/')
  • Negation patterns in arrays use AND-NOT logic — '!*.js' in an array with '*.ts' means: match .ts files that don't match *.js (use micromatch.not() for pure negation filtering)
  • Dot files (hidden files starting with .) are not matched by ** or * by default — pass { dot: true } option to include them
  • Brace expansion is enabled by default — '*.{js,ts}' works out of box, but complex nested braces may have edge cases
  • micromatch.isMatch() vs micromatch() — isMatch checks a single string, micromatch() filters an array; choose the right method for the use case
  • Pattern caching is built-in but pattern-heavy applications should reuse compiled patterns rather than repeatedly passing the same patterns to micromatch

Alternatives

Full Evaluation Report

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

$99

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

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