minimatch

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

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
52 /100 Fair
Development Activity 24
Maintenance 8
Community 76
Maturity 60
Momentum 40

Technical Analysis

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

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

TypeScript
87%
MIT

medusa

Ecommerce

36,897

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
94
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 87%
JavaScript 12%
Updated 6 days ago
TypeScript
95%
MIT

melty

AI Code Assistants · Code Editors · Developer Tools

5,462

The AI code editor where every chat message is a git commit you can revert, branch, or squash

View details
35
Repo Health
75
Technical
67
Dependency
Built with
TypeScript 95%
Updated 1 years ago
TypeScript
53%
MIT

MentraOS

AI Development · Developer Tools

2,391

The open source operating system and SDK that lets developers build one app and run it across smart glasses from Even Realities, Vuzix, Mentra Live, and more.

View details
92
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 53%
Java 16%
Updated 5 days ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 6 days ago
TypeScript
84%
Apache 2.0

nao

AI Development · Analytics

1,949

Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.

View details
85
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 84%
Python 15%
Updated 5 days ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,686

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
90%
MIT

OpenClaw

AI Agents · AI Assistants

392,894

An open-source AI assistant that runs on your own hardware and meets you in Discord, Slack, WhatsApp, iMessage, Telegram, and 20+ other channels, with native apps for every major platform.

View details
88
Repo Health
88
Technical
66
Dependency
Built with
TypeScript 90%
Updated 5 days ago
TypeScript
81%
MIT

OpenCode

AI Code Assistants

220,711

A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.

View details
89
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 81%
MDX 16%
Updated 5 days ago
TypeScript
85%
MIT

openwork

AI Assistants · Automation

24,237

OpenWork is a free, open-source desktop app for running AI agent workflows on your own files with 50+ LLMs, extensible skills, and MCP server support — the open-source alternative to Claude Cowork and Codex.

View details
87
Repo Health
89
Technical
67
Dependency
Built with
TypeScript 85%
Updated 5 days 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