Picomatch

Blazing-fast, dependency-free glob matcher for JavaScript with full Bash-extglob support.

Library
npm
v4.0.5
1,286stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
69/100Good
Development Activity60
Maintenance48
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture84
Code Quality88
Innovation82
Learning Curve78

Picomatch is a minimal, dependency-free glob matching library for JavaScript. It compiles glob patterns (wildcards, globstars, extglobs, braces, and POSIX character classes) into native regular expressions, giving you accurate Bash-style pattern matching without the overhead of shelling out or maintaining a bundled pattern engine.

It is the matching engine underneath micromatch and is used directly or transitively by build tools, test runners, and file watchers across the JavaScript ecosystem, including Jest, Astro, Rollup, Storybook, Snowpack, and fast-glob, and is reported as a dependency of more than five million projects.

What You Get

  • A picomatch(glob, options) function that compiles one or more glob patterns into a reusable matcher function
  • Full Bash-compatible glob syntax: wildcards (*, ?), globstars (**), extglobs (!(a|b), +(a)), brace expansion ({a,b}), and POSIX bracket expressions ([[:alpha:]])
  • Lower-level primitives (.scan, .parse, .compileRe, .makeRe, .toRegex) for implementors who want to inspect or reuse the parsing pipeline directly
  • A dependency-free picomatch/posix entry point for environments without Node.js path detection
  • Options for negation, dotfile matching, basename-only matching, custom ignore patterns, and match/result callbacks (onMatch, onIgnore, onResult)

Common Use Cases

  • Filtering file paths in a file watcher (e.g. deciding which changed files should trigger a rebuild)
  • Implementing include/exclude glob options in a build tool, bundler, or test runner
  • Matching against user-supplied glob patterns in CLI tools without invoking a shell
  • Powering higher-level glob libraries (micromatch, fast-glob) that need an accurate, fast matching primitive

Under The Hood

Architecture - The public entry point (index.js) wraps the core matcher in lib/picomatch.js with OS detection, defaulting options.windows via utils.isWindows() before delegating to the shared implementation (also reachable dependency-free through posix.js). Matching is a three-stage pipeline: lib/scan.js (391 lines) walks the pattern character-by-character to split it into a static prefix/base and the actual glob segment, lib/parse.js (the largest file at ~1,416 lines / 35KB) tokenizes and translates glob syntax such as extglobs, braces, and POSIX classes into a regex source string, and picomatch.compileRe wraps that source in anchors and negation logic before toRegex compiles it into a real RegExp. picomatch() itself returns a closure holding the compiled regex so repeat calls against many input strings reuse the same RegExp instead of re-parsing the pattern.

Tech Stack - Zero runtime dependencies; the package is pure, dependency-free JavaScript targeting Node >=12 with a CommonJS main/lib layout. Dev tooling is ESLint 8 plus Mocha/nyc for tests and coverage, with fill-range only as a devDependency used in the test suite, and gulp-format-md/verb for generating the README from .verb.md.

Code Quality - The test/ directory contains 37 spec files covering bash-compatibility, extglobs, braces, brackets, negation, dotfiles, malicious-input handling, and Windows/POSIX slash behavior, run via npm run mocha with nyc coverage reporting (test:cover) wired into CI. Source files use consistent JSDoc blocks with runnable examples above every exported function, 'use strict' pragmas, and small single-purpose helpers in lib/utils.js (e.g. escapeRegex, toPosixSlashes, basename) rather than inlined logic, though the parser (lib/parse.js) is dense and stateful by necessity of handling recursive glob grammar.

API Design - The primary API is a single function, picomatch(glob, options), that returns a matcher you call with a string, which keeps the common case to one line (picomatch('*.js')('a.js')). Every exported method mirrors this minimal-argument style and is documented inline with copy-pasteable examples, and lower-level primitives (.scan, .parse, .makeRe, .compileRe) are exposed for tool authors who need to inspect or reuse pipeline internals without forking the library, at the cost of a larger overall surface area for newcomers who only need the top-level function.

Used by 19 apps in this directory

TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,872

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
95
Repo Health
82
Technical
66
Dependency
Built with
TypeScript100%
Updated yesterday
TypeScript
97%
Apache 2.0

Cline

AI Code Assistants

66,453

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
67
Dependency
Built with
TypeScript97%
Updated today
C
89%
MIT

codegraph

Developer Tools · AI Code Assistants

67,011

A pre-indexed code knowledge graph that cuts AI tool calls by 58% and token costs by 16% — auto-syncing, 100% local, works with Claude Code, Cursor, Codex, and more.

View details
81
Repo Health
85
Technical
73
Dependency
Built with
C89%
Updated 1 weeks ago
Ruby
62%
GPL 2.0

Discourse

Community

47,672

Open-source community platform with dynamic trust levels, real-time chat, and a powerful plugin architecture for self-hosted forums.

View details
89
Repo Health
89
Technical
67
Dependency
Built with
Ruby62%
JavaScript31%
Updated today
TypeScript
97%
Other

Infisical

Security · Devops

28,838

The open-source platform for secrets, certificates, privileged access, and AI agent security — all in one self-hostable system.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript97%
Updated today
TypeScript
95%
Apache 2.0

InsForge

Developer Tools · Databases

12,741

The all-in-one, open-source backend platform purpose-built for AI coding agents — giving your agent database, auth, storage, edge functions, a model gateway, and compute to ship full-stack apps end-to-end.

View details
86
Repo Health
81
Technical
73
Dependency
Built with
TypeScript95%
Updated yesterday
TypeScript
97%
Other

Kibana

Analytics · Monitoring

21,251

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
68
Dependency
Built with
TypeScript97%
Updated today
TypeScript
98%
MIT

Kimi Code CLI

AI Code Assistants · AI Agents · Developer Tools

6,908

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
81
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated today
TypeScript
98%
Apache 2.0

letta-code

AI Code Assistants · AI Assistants

3,050

A memory-first coding agent harness that learns from experience, maintains identity across models, and works across Claude, GPT, Gemini, and dozens more LLMs.

View details
84
Repo Health
84
Technical
78
Dependency
Built with
TypeScript98%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search