1. License
“Permission is hereby granted, free of charge, to any person obtaining a copy”
MIT allows use in paid and closed-source apps.
github.com/micromatch/picomatch/blob/master/LICENSE3. Used by agents' projects
Dependency in 20 public GitHub projects set up for AI coding agents that we scanned (0.3%).
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 picomatch does
picomatch is a small free JavaScript library that answers one question: does this file path match a pattern like src/**/*.js? You give it a pattern once and get back a quick yes-or-no check. It only compares names you already have; it does not search your disk.
What people build with it
React only to files that matter
A file watcher or build script hears about every changed file; one reused pattern check decides which ones should trigger a rebuild.
Skip tests and hidden files
A deploy script picks every JavaScript file except tests, and leaves hidden files like .env out unless you ask for them.
Accept only some upload types Idea
An upload form lets through names ending in png, jpg or webp in any letter case, as a quick first filter before a real file check.
Paths from Windows users
Paths typed on Windows use backslashes; turn on the Windows option so src\ui\button.js is seen as a file inside a folder.
Find where a pattern starts
Split a pattern like src/**/*.js into the fixed folder (src) and the wildcard part, so your tool only reads the folder it needs.
Pattern rules in admin settings Idea
Let editors type rules like docs/** or *.pdf in a settings page to decide which stored files are public.
picomatch popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How picomatch is used
- picomatch is a dependency in 20 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.4% of the 4,867 JavaScript/TypeScript ones), #74 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 99; 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 Zod (90.0%), Vitest (75.0%), yaml (60.0%).
By coding agent
Often used with
More about picomatch
Funding
- GitHub Sponsors: https://github.com/doowb
- GitHub Sponsors: https://github.com/jonschlinkert
- 4 GitHub sponsors
Alternatives
picomatch This page
Pick minimatch when you want the matcher that npm and the glob package use, with brace expansion built in.
Pick micromatch when you need brace ranges such as {01..03} or helpers that filter whole lists; its README names it for advanced braces.
Correct and fast file pattern matching for file system operations.
Get started
Tell your AI assistant
“Use picomatch (pin picomatch@4.0.7) to build one matcher per pattern at startup and filter the file paths we already have; pass {dot: true} if hidden files count and {windows: true} if paths may use backslashes.”
Install it into your project.
npm install --save picomatchMake a matcher from a pattern once, then call it on each path.
const pm = require('picomatch'); const isMatch = pm('*.js'); console.log(isMatch('abcd')); //=> false console.log(isMatch('a.js')); //=> true console.log(isMatch('a.md')); //=> false console.log(isMatch('a/b.js')); //=> falseOutside Node.js (a browser or an edge worker), load picomatch/posix, which has no operating-system check.
const picomatch = require('picomatch/posix');
Mistakes to avoid
A single * stops at a slash; in our run '*.js' gave false for 'a/b.js' and true with basename: true.
Since 3.0 a call without options uses forward slashes only; in our demo the backslash path matched '*.js' as one name and missed 'src/**/*.js'.
Dotfiles are skipped by default; our demo shows src/.env matched only with dot: true.
picomatch never touches the disk.
4.0.4 fixed a ReDoS (CVE-2026-33671) from crafted nested extglobs, and the fix was backported to 2.3.2 and 3.0.2.
Questions
Can it find files in a folder?
No. It only checks path strings you give it; no library in its comparison table does file system work.
Why does *.js not match src/app.js?
A single star does not cross folders. Use **/*.js, or the basename option to match only the file name.
Does it treat backslashes as folder separators on Windows?
Only with windows: true. A call without options uses forward slashes; with an options object, picomatch() checks the platform.
Can I use it in the browser?
Yes. The picomatch/posix entry has no dependencies and skips the operating-system check.
Can I use it in a paid product?
Yes, it is MIT licensed; keep its license notice in copies you ship.