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.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Pure local computation — no network, no credentials. ReDoS-resistant via picomatch's efficient regex compilation. MIT licensed. No data leaves the process.
⚡ 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
Authentication
Local npm library — no authentication required.
Pricing
MIT licensed open source library. Zero cost.
Agent Metadata
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.
Scores are editorial opinions as of 2026-03-06.