Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

picomatch

Check file paths against glob patterns.

UtilitiesNPM

GitHubWebsite

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/LICENSE

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

62 / 100
Gid Score, #862 overall
743M
downloads a week, npm
1,338
GitHub stars
20
agent projects use it
picomatch: downloads per weeknpm, picomatch 743,236,414
picomatch: GitHub starsmicromatch/picomatch 1,338

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

17 projects, 0.5%
14 projects, 0.5%
6 projects, 0.2%

Often used with

In 90.0% of its projects
In 75.0% of its projects
In 60.0% of its projects
In 55.0% of its projects
In 50.0% of its projects
In 50.0% of its projects
In 55.0% of its projects

More about picomatch

Funding
  • GitHub Sponsors: https://github.com/doowb
  • GitHub Sponsors: https://github.com/jonschlinkert
  • 4 GitHub sponsors

See all

More in Utilities

Alternatives

picomatch This page

MITGid 62743M/wk

minimatch

Pick minimatch when you want the matcher that npm and the glob package use, with brace expansion built in.

micromatch

Pick micromatch when you need brace ranges such as {01..03} or helpers that filter whole lists; its README names it for advanced braces.

glob

Correct and fast file pattern matching for file system operations.

BlueOak-1.0.0Gid 74557M/wk

Compare picomatch with another tool

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.”

  1. Install it into your project.

    npm install --save picomatch

    From github.com/micromatch/picomatch/blob/master/README.md

  2. Make 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')); //=> false
    

    From github.com/micromatch/picomatch/blob/master/README.md

  3. Outside Node.js (a browser or an edge worker), load picomatch/posix, which has no operating-system check.

    const picomatch = require('picomatch/posix');

    From github.com/micromatch/picomatch/blob/master/README.md

Mistakes to avoid

picomatch('*.js') to find .js files in subfolders
picomatch('**/*.js'), or {basename: true} to match only the file name

A single * stops at a slash; in our run '*.js' gave false for 'a/b.js' and true with basename: true.

Matching Windows paths like 'src\ui\a.js' with picomatch(pattern) and no options
Pass {windows: true}, or turn backslashes into slashes first

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'.

Expecting src/** to include src/.env or .github files
Add {dot: true} when hidden files should count

Dotfiles are skipped by default; our demo shows src/.env matched only with dot: true.

Using picomatch to get the list of files in a folder
List files with glob or tinyglobby, then use picomatch to filter names you already have

picomatch never touches the disk.

A lockfile still pinning picomatch below 2.3.2, 3.0.2 or 4.0.4 while users can type patterns
Update to 4.0.7 (or at least 2.3.2 / 3.0.2 on old major lines)

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.