minimatch

The minimal glob matcher used internally by npm — converts glob patterns into JavaScript RegExp objects.

Library
npm
v10.2.6
3,519stars
BlueOak-1.0.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
58/100Fair
Development Activity48
Maintenance8
Community76
Maturity60
Momentum40

Technical Analysis

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

Minimatch is a minimal glob-matching utility that converts shell-style glob expressions into JavaScript RegExp objects, then tests file paths against them. It is the matching library used internally by npm and sits at the foundation of the wider glob ecosystem.

Beyond simple *.js wildcards, minimatch supports brace expansion, extended glob (extglob) patterns, ** globstar matching across directories, POSIX character classes, negation, and a large set of options for case-sensitivity, partial matching, and Windows path handling.

What You Get

  • A single minimatch(path, pattern, options) function that returns whether a path matches a glob
  • A reusable Minimatch class exposing the parsed set, compiled regexp, and match helpers
  • Utility helpers: filter (for Array.filter), match (fnmatch/glob-style list matching), makeRe, escape, and unescape
  • Full TypeScript types shipped as a hybrid ESM/CommonJS module
  • An extensive option set covering brace expansion, extglobs, globstar, case-insensitivity, partial matching, and Windows path semantics

Common Use Cases

  • Filtering lists of file paths against a glob pattern (the core of tools like glob and rimraf)
  • Implementing include/exclude rules in build tools, bundlers, linters, and test runners
  • Matching .gitignore-style or package.json files-style path patterns
  • Reusing a compiled pattern across many paths for performance-sensitive directory walks

Under The Hood

Architecture

Minimatch’s pipeline lives in src/index.ts (the Minimatch class and top-level minimatch function) supported by src/ast.ts, which builds an abstract syntax tree from the pattern. A pattern is first split by / into path parts; braces are expanded via the external brace-expansion dependency into a 2-dimensional set where each row is a brace-expanded variant and each element is a path segment. Each segment is parsed by the AST in ast.ts (handling extglobs, character classes from src/brace-expressions.ts, and globstar) and compiled either to a literal string or a RegExp. Matching walks the split filename against a row via matchOne, with special-casing for ** globstar traversal and Windows UNC/drive-letter roots. src/assert-valid-pattern.ts guards against oversized patterns as a ReDoS mitigation.

Tech Stack

Written in TypeScript targeting Node 18/20/22+, with brace-expansion as its only runtime dependency. It builds via tshy into a hybrid package that ships both ESM and CommonJS entry points with type declarations. Dev tooling includes tap for testing, oxlint for linting, prettier for formatting, and typedoc for API docs.

Code Quality

The repository has an extensive test/ suite (25+ files) covering basics, brace expansion, extglobs, negation, partial matching, Windows path separators, UNC paths, optimization levels, and a dedicated redos.js for regular-expression denial-of-service edge cases, plus tap snapshots. Options are documented inline with JSDoc on the MinimatchOptions interface. The code is dense but well-organized into single-responsibility modules (escape.ts, unescape.ts, brace-expressions.ts, assert-valid-pattern.ts).

API Design

The public API is deliberately small and ergonomic: minimatch('bar.foo', '*.foo') reads naturally, while the Minimatch class exposes lower-level internals (set, regexp, matchOne) for glob-walkers that need to avoid excessive filesystem calls. Every option is a boolean flag with a clear name, and the README documents each one exhaustively. TypeScript types and hybrid module output make it drop-in for both import and require.

Used by 35 apps in this directory

TypeScript
94%
MIT

Actual

Invoicing Finance

28,224

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated yesterday
TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
84%
MIT

Amical

Note Taking · AI Assistants

1,495

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
79
Repo Health
82
Technical
67
Dependency
Built with
TypeScript84%
Updated 3 weeks ago
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,220

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
92
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated today
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
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,633

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
65
Repo Health
76
Technical
63
Dependency
Built with
JavaScript90%
Updated 1 months ago
TypeScript
84%
Apache 2.0

Continue

Developer Tools · AI Development · AI Code Assistants

35,532

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
87
Repo Health
88
Technical
65
Dependency
Built with
TypeScript84%
Updated today
TypeScript
80%
Other

Directus

CMS · Low Code Platforms

37,462

Connect any SQL database and get instant REST and GraphQL APIs, a visual management Studio, and a native MCP server for AI agents — free for most organizations.

View details
93
Repo Health
82
Technical
78
Dependency
Built with
TypeScript80%
Vue18%
Updated yesterday

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