globby

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

Library
npm
v16.2.3
2,649stars
MIT License

Repository Health

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

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture78
Code Quality82
Innovation65
Learning Curve85

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
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
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
Python
54%
Other

authentik

Authentication · Security

24,980

The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.

View details
92
Repo Health
81
Technical
68
Dependency
Built with
Python54%
TypeScript33%
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
C++
51%
Other

Cocos Engine

Developer Tools · Game Development · Design Tools

9,761

Open-source, cross-platform 2D/3D game engine with Vulkan, Metal, and WebGL support for web, mobile, and instant gaming platforms

View details
68
Repo Health
79
Technical
71
Dependency
Built with
C++51%
TypeScript35%
Updated 1 months ago
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
Ruby
67%
Other

GitLab

Devops · Developer Tools

24,533

The complete DevOps platform that unifies Git hosting, CI/CD, issue tracking, and security scanning into a single self-hostable application.

View details
87
Repo Health
86
Technical
70
Dependency
Built with
Ruby67%
JavaScript20%
Updated today
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,367

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
66
Dependency
Built with
TypeScript71%
Go16%
Updated yesterday
TypeScript
99%
MIT

KeystoneJS

CMS · Developer Tools

9,957

The superpowered headless CMS for developers built with GraphQL and React

View details
91
Repo Health
81
Technical
64
Dependency
Built with
TypeScript99%
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