globby

User-friendly glob matching for Node.js, built on fast-glob with negation, directory expansion, and gitignore support.

Library
npm
v16.2.4
2,649 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
60 /100 Good
Development Activity 36
Maintenance 48
Community 56
Maturity 60
Momentum 40

Technical Analysis

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

globby wraps fast-glob with a batch of ergonomic conveniences: a promise-based API, support for multiple patterns in a single call, negated and negation-only patterns, automatic expansion of directory patterns into recursive globs, and native .gitignore-aware filtering. It is one of the most widely used file-globbing libraries in the Node.js ecosystem, relied on by build tools, linters, and CLIs to resolve file lists from user-supplied patterns.

When gitignore mode is enabled, globby reads .gitignore files from the working directory up through the repository root before globbing, and proves which ignored directories can be safely skipped during traversal (rather than enumerated and filtered afterward), so large ignored trees like node_modules don’t slow down the scan while still matching Git’s exact ignore semantics, including negation patterns.

What You Get

  • A globby(patterns, options?) promise API returning matched file paths, plus a synchronous globbySync variant
  • Multiple and negated pattern support in a single call (['foo*', '!foobar'])
  • Automatic directory expansion (foo becomes foo/**/*) configurable via expandDirectories
  • Native .gitignore support that walks parent directories to the repo root and matches Git’s exact ignore semantics
  • convertPathToPattern() for safely turning a filesystem path into a valid glob pattern (handling Windows backslashes)
  • URL support as a cwd value alongside plain string paths

Common Use Cases

  • Resolving a build tool’s or bundler’s input file list from user-configured glob patterns
  • Writing a lint/format CLI that needs to skip .gitignored files automatically without re-implementing Git’s ignore rules
  • Expanding a directory argument (src) into every file beneath it as part of a CLI’s file-discovery step
  • Finding files to process in a Gulp-style task pipeline where multiple glob patterns need combining with exclusions

Under The Hood

Architecture: index.js (707 lines) is the core entrypoint, translating globby’s higher-level options (expandDirectories, gitignore, onlyFiles, etc.) into one or more fast-glob calls, then merging/deduplicating the resulting path streams (via @sindresorhus/merge-streams for the streaming variant). ignore.js (1016 lines) is the largest module and implements gitignore-aware filtering: it discovers .gitignore files from the cwd up to the detected repository root, compiles them with the ignore package, and — critically for performance — proves which directories are provably fully ignored (no negation pattern could re-include their contents) so those directories are excluded from fast-glob’s own traversal instead of being walked and filtered after the fact. utilities.js (554 lines) holds shared helpers like directory-expansion logic and path/pattern normalization (including convertPathToPattern). Tech Stack: Pure ESM (type: module, Node.js >=20 required), built on fast-glob for the underlying matching engine, ignore for gitignore-pattern compilation, @sindresorhus/merge-streams for combining async iterables, is-path-inside and slash/unicorn-magic for path handling; devDependencies show a benchmark harness (bench.js) that compares against glob-stream and a main-branch fork of itself, plus xo (linting), ava (tests), and tsd (type-definition tests). Code Quality: The tests/ directory has ten focused test files (globby.js, ignore.js, gitignore-comprehensive.js, gitignore-vs-git.js, global-gitignore.js, global-gitignore-custom-fs.js, parent-directory-patterns.js, convert-path-to-pattern.js, generate-glob-tasks.js, utilities.js) that specifically stress-test the gitignore-matching-Git-behavior guarantee — including a dedicated gitignore-vs-git.js file that appears to diff globby’s ignore behavior directly against real Git output — which is a strong quality signal for a feature whose entire value proposition is ‘matches Git exactly.’ TypeScript types are validated via tsd against index.test-d.ts. API Design: The single globby(patterns, options) promise entrypoint (with a synchronous twin) covers the vast majority of use cases with no configuration required for the common case, while options like expandDirectories and gitignore are opt-in booleans rather than required setup — the README’s copy-pasteable three-line usage example demonstrates the entire happy path, and pattern negation reuses familiar glob syntax (!pattern) rather than a separate exclude option.

Used by 19 apps in this directory

TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,338

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 6 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,195

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Onlook

AI Design Tools · Design Tools

26,996

An open-source, AI-first visual editor that lets designers and developers build, style, and deploy React apps directly in code — no handoff required.

View details
63
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
Go
36%

OpenPanel

Devops · Hosting Control Panel

764

Docker-powered web hosting control panel that gives every user a fully isolated environment with dedicated web server, database, and networking — VPS-grade security on shared hardware.

View details
87
Repo Health
75
Technical
63
Dependency
Built with
Go 36%
HTML 30%
TypeScript 24%
Updated 1 weeks ago
JavaScript
64%
AGPL 3.0

overleaf

Collaboration · Productivity

18,266

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
84
Repo Health
80
Technical
59
Dependency
Built with
JavaScript 64%
TypeScript 30%
Updated 1 months ago
TypeScript
96%
MIT

Payload CMS

Blogging · CMS · Developer Tools

45,458

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
92
Repo Health
88
Technical
65
Dependency
Built with
TypeScript 96%
Updated 6 days ago
Python
99%
Apache 2.0

Rasa Open Source

AI Assistants · AI Development · Voice AI

21,353

Rasa Open Source is a Python machine learning framework for building contextual, multi-turn chatbots and voice assistants that understand natural language and maintain conversation state.

View details
62
Repo Health
78
Technical
63
Dependency
Built with
Python 99%
Updated 3 months ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated 6 days ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,123

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 6 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