Picomatch

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

Library
npm
v4.0.7
1,296 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
84 /100 Excellent
Development Activity 92
Maintenance 72
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
83 /100 Excellent
Architecture 84
Code Quality 88
Innovation 82
Learning Curve 78

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 22 apps in this directory

TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,924

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
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 100%
Updated 2 weeks ago
TypeScript
98%
Apache 2.0

Cline

AI Code Assistants

69,455

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
65
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
C
83%
MIT

codegraph

AI Code Assistants · Developer Tools

72,201

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
84
Repo Health
85
Technical
70
Dependency
Built with
C 83%
TypeScript 14%
Updated 1 weeks ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
Ruby
61%
GPL 2.0

Discourse

Community

47,915

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
Ruby 61%
JavaScript 32%
Updated 1 weeks ago
TypeScript
97%
Other

Infisical

Devops · Security

29,468

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
65
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
TypeScript
93%
Apache 2.0

InsForge

Databases · Developer Tools

13,023

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
85
Repo Health
81
Technical
72
Dependency
Built with
TypeScript 93%
Updated 1 weeks ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,301

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
63
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
TypeScript
98%
MIT

Kimi Code CLI

AI Agents · AI Code Assistants · Developer Tools

7,705

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
82
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago

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