Micromatch
Fast, POSIX-compliant glob matching for Node.js — the drop-in replacement for minimatch and multimatch.
Repository Health
Technical Analysis
Micromatch is a highly optimized wildcard and glob matching library for JavaScript and Node.js. It matches lists of strings against one or more glob patterns and is built to be a faster, more accurate drop-in replacement for minimatch and multimatch, supporting extglobs, brace expansion, POSIX character classes, and regex character classes and groups.
It underpins file-filtering logic across a huge share of the JavaScript build and tooling ecosystem — webpack, Babel, Jest, Yarn, ESLint, stylelint, nyc, and Ava all depend on it to decide which files a glob pattern includes or excludes, so its correctness and performance directly affect the reliability of those tools.
What You Get
- A single default export
micromatch(list, patterns, options)that filters a list of strings against one or more glob patterns, including negated patterns (!foo/*.js) - Boolean matching helpers —
isMatch,some,every,all,contains— for testing single strings or lists without building an intermediate result array - A
matcher(pattern, options)factory that compiles a pattern once into a reusable predicate function for repeated matching in hot paths - Extended globbing support: extglobs (
+(x|y),!(a|b)), POSIX bracket expressions ([[:alpha:][:digit:]]), regex character classes, and regex logical-or groups - Brace expansion (
foo/{1..5}.md,bar/{a,b,c}.js) delegated to the companionbraceslibrary, withbraces()andbraceExpand()exposed directly - Utility functions for regex generation and introspection:
makeRe,scan,parse, andcapturefor extracting captured groups from a match
Common Use Cases
- Filtering which files a build tool (bundler, linter, test runner) should include or exclude based on glob patterns in config
- Implementing
.gitignore-style include/exclude rules for CLI tools that walk a file tree - Filtering object keys or arbitrary string lists by wildcard pattern with
matchKeysandnot - Compiling a glob pattern to a native
RegExpviamakeRefor use in custom matching pipelines
Under The Hood
Architecture — Micromatch’s own index.js is a thin orchestration layer, not the pattern-matching engine itself: it delegates regex compilation and single-pattern matching to picomatch, and brace expansion to the braces library, while owning the higher-level concerns of multi-pattern list filtering, negation semantics, and result deduplication. The core micromatch() function iterates each pattern, builds a picomatch matcher for it, and uses Set-based keep/omit accumulators to correctly resolve mixed positive and negated patterns (e.g. ['*.js', '!foo.js']) into a single filtered list, falling back to nonull/nullglob/failglob options when nothing matches. The rest of the public API (isMatch, some, every, all, contains, matchKeys, capture, makeRe, scan, parse) are largely convenience wrappers that reshape calls into picomatch invocations for different call signatures. Tech Stack — The package has exactly two runtime dependencies, braces@^3.0.3 for brace expansion and picomatch@^2.3.1 for pattern-to-regex compilation, and ships as a single unbuilt index.js file (per package.json’s files field) with no bundler or transpilation step — the published code is the source code. Development tooling is minimal: mocha for the test runner, minimatch as a devDependency for parity testing, and gulp-format-md for generating the README via the verb toolchain referenced in package.json. There is no TypeScript in the repo itself; type definitions are maintained externally via DefinitelyTyped. Code Quality — The test suite is extensive: 36 test files under test/, including per-method API tests (api.isMatch.js, api.match.js, api.some.js, etc.) and a dedicated bash.spec.js/bash.js pair that runs micromatch against Bash’s own glob-matching spec fixtures, backing the README’s claim of over 5,000 test assertions. Source code is a single, consistently styled file with JSDoc comments on every exported method, explicit TypeError throws for invalid input types (e.g. contains and all reject non-string input), and no dead or speculative code paths. API Design — The API mirrors minimatch and multimatch’s familiar call shapes closely enough that the README documents direct drop-in replacements for both (mm.isMatch() for minimatch(), mm.match() for minimatch.match()), minimizing migration friction. Every method follows the same (subject, patterns, options) argument order, and the boolean-returning helpers (isMatch, some, every, all, contains) give callers a predictable vocabulary for different matching needs without having to post-process array results.
Used by 13 apps in this directory
browserless
Developer Tools · Automation
Run headless Chrome, Firefox, and WebKit as a managed Docker service — drop-in Puppeteer and Playwright support with no infrastructure overhead.
Codebuff
AI Code Assistants
An open-source AI coding assistant that coordinates specialized agents to edit your codebase from natural language — including Freebuff, a free, ad-supported version powered entirely by open-source models like DeepSeek and Kimi.
CodeSandbox
Code Editors · Developer Tools
Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.
Dokploy
Devops · Hosting Control Panel · Security
Self-hosted PaaS that deploys apps and databases on your own VPS using Docker, Traefik, and multi-build-system orchestration
GitLab
Devops · Developer Tools
The complete DevOps platform that unifies Git hosting, CI/CD, issue tracking, and security scanning into a single self-hostable application.
lila (Lichess)
Community
The forever-free, ad-free, open-source chess server powering millions of real-time games, AI analysis, puzzles, and tournaments worldwide.
localforge
AI Code Assistants · AI Agents · Developer Tools
A local, multi-provider AI coding agent with a real desktop and web UI — bring your own Anthropic, OpenAI, Gemini, Bedrock, or local Ollama keys and let it read, edit, and run code in your own project folder.
Metabase
Analytics
The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.
Passbolt API
Password Manager · Security
Self-hosted, end-to-end encrypted password manager API built for teams who demand full ownership of their credentials.