1. License
“Each contributor licenses you to do everything with this software that would otherwise infringe that contributor's copyright in it.”
The Blue Oak license grants every use the copyright covers, paid or not.
github.com/isaacs/minimatch/blob/main/LICENSE.md3. Used by agents' projects
Dependency in 30 public GitHub projects set up for AI coding agents that we scanned (0.5%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What minimatch does
minimatch is a small free JavaScript library that answers one question: does this file path match a pattern like src/**/*.ts or *.{png,jpg}? Your scripts and tools use it to pick, skip or group files by name. It only compares text; listing the files on disk is the job of the glob library, which uses minimatch inside.
What people build with it
Run only the changed tests
From the list of files changed in a pull request, keep only the test files and run just those.
Keep secrets out of uploads Idea
Before a deploy or backup script uploads a folder, it skips .env files, logs and build output by pattern.
Skip folders that cannot match
A tool that walks a big folder tree stops going into folders whose path can never fit the pattern.
Find a file whose name has a star
Match a user's file called report[final]*.pdf by its exact name, without the brackets and star acting as wildcards.
Accept photos in any letter case
An import tool picks up photo.JPG as well as photo.jpg when the user's rule says *.{png,jpg}.
Let users set include rules Idea
Your app's settings file takes lines like src/**/*.md, and the app treats only matching files.
minimatch popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How minimatch is used
- minimatch is a dependency in 30 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.6% of the 4,867 JavaScript/TypeScript ones), #48 of 408 in utilities.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 85; those are left out of every share on this page.
- The most used alternative in our scan is glob (122 projects).
- Projects that use it most often also use Vitest (73.3%), Model Context Protocol SDK (JavaScript) (60.0%), tsx (56.7%).
By coding agent
Often used with
More about minimatch
Funding
- GitHub Sponsors: https://github.com/isaacs
- 23 GitHub sponsors
Alternatives
minimatch This page
Pick picomatch when you need a regular expression made from a glob, which minimatch 11 no longer offers.
Pick micromatch when your project already uses it; it is a glob matcher offered as an alternative to minimatch.
Pick glob when you need the list of matching files on disk rather than a yes or no for one path.
Get started
Tell your AI assistant
“Use the npm package minimatch (pin minimatch@11.0.5, Node.js 20 or 22+) with the named import { minimatch }, forward slashes only in patterns, and { dot: true } where dot files must match; never build patterns from untrusted user input.”
Add minimatch to a project that runs on Node.js 20, or 22 and newer.
Import the named function and test a path against a pattern.
// hybrid module, load with require() or import import { minimatch } from 'minimatch' // or: // const { minimatch } = require('minimatch') minimatch('bar.foo', '*.foo') // true! minimatch('bar.foo', '*.bar') // false!
Mistakes to avoid
There is no default export since 9.0; in our run the module had no default.
Version 11 removed both; in our run makeRe was undefined.
A backslash escapes the next character; in our run src\*.ts did not match src/app.ts.
Dot files are skipped by default; in our demo .env matched only with { dot: true }.
Patterns from untrusted input can make any glob matcher slow or behave unexpectedly.
Questions
Does it find files on my disk?
No. It only says whether a path string fits a pattern; the glob library uses it to list files.
Why does import minimatch from 'minimatch' fail?
Since version 9 there is no default export; use import { minimatch } from 'minimatch'.
Where did minimatch.makeRe go?
Version 11 removed makeRe and the regexp property; it now matches each path part without regular expressions.
Which wildcard features does it support?
Brace sets like {png,jpg}, extended patterns like +(a|b), ** across folders and POSIX character classes.