GitShow/sindresorhus/globby
sindresorhus

globby

User-friendly glob matching

by sindresorhus
directoriesfilesglobglobbingjavascriptmatchingnodejspatterns
Star on GitHubForknpm

JavaScript

2.6k stars139 forks51 contributorsActive · 5d agoSince 2014v16.2.4MIT

Meet the team

See all 51 on GitHub →
sindresorhus
sindresorhus159 contributions
fisker
fisker26 contributions
UltCombo
UltCombo16 contributions
kevva
kevva9 contributions
schnittstabil
schnittstabil5 contributions
marionebl
marionebl4 contributions
antongolub
antongolub3 contributions
BendingBender
BendingBender2 contributions

Languages

View on GitHub →
JavaScript97.7%
TypeScript2.3%

Commit activity

Last 12 weeks · 9 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
ColtHands
If .gitignore is caught by `ignore` option `gitignore: true` does not ignore files and outputs them regardlessClosedIssue

Subj, does not ignore files. Test repro: test with node v24.16.0 globby 16.2.2

ColtHands · 5d ago
yamadashy
`gitignore: true` crashes on Windows when a rule starts with a backslash escape and a wildcard negation is presentClosedIssue

Regression in 16.2.2 (16.2.1 is fine). On Windows, any .gitignore rule that starts with a backslash escape crashes the glob when the file also contains a negation whose final segment is a glob. That includes the documented idioms for names starting with or (, ), not just junk rules: Backslash junk like also exists in real .gitignore files (microsoft/data-formulator line 416), which is how this was hit downstream: yamadashy/repomix#1765. Cause The new pruning logic compares each rule against negation names using the package; when the negation's final segment is a glob, passes the raw rule text to as if it were a path (, via → ). rewrites backslashes to slashes only in its Windows mode; its relative-path validation (active on every platform) then rejects the leading slash that results: → → throws. Mid-rule backslashes () are unaffected — only a leading escape produces a leading slash. This is also why the bug is Windows-only, and why CI didn't catch it: the windows-latest leg in main.yml is currently commented out. Failing tests Ready on , covering both the idiom and the real-world . The tests force 's Windows mode through its exposed test hook (), so they fail on every platform; on actual Windows the hook is a no-op.

yamadashy · 2w ago
willemkokke
`gitignore: true` enumerates ignored directories before excluding themClosedIssue

Description We mount a large network share as a subfolder of a repository and list it in . markdownlint-cli2 uses globby with , so we expected the share to be skipped - instead every lint run crawls it in full over the network. The option starts by globbing for before any pattern is known, so the share is enumerated just to discover ignore files, before the rule that excludes it is ever applied. Two more things compound it: A single negation anywhere () disables forwarding to fast-glob's entirely, so the main glob also traverses every ignored directory and filters afterwards. Running from a subdirectory of a repository (e.g. a monorepo package) forwards nothing at all, because the patterns have been rebased onto the git root. Numbers 10k files in an ignored directory, instrumented, globby 16.2.1: git itself skips the directory instantly. On a network mount each of those reads is a round trip. Fix A fix is ready on : provably-safe prune patterns are handed to fast-glob (the predicate stays authoritative, so over-pruning is impossible by construction), and the ignore-file search prunes itself the same way. All three scenarios drop to 0 reads with byte-identical results, verified against across 35 conformance tests. We tried to open the PR but the repository currently limits interactions to collaborators; we will open it as soon as the limit lifts.

willemkokke · 4w ago
Structured data for AI agents

Repository: sindresorhus/globby. Description: User-friendly glob matching Stars: 2650, Forks: 139. Primary language: JavaScript. Languages: JavaScript (97.7%), TypeScript (2.3%). License: MIT. Topics: directories, files, glob, globbing, javascript, matching, nodejs, patterns. Latest release: v16.2.4 (5d ago). Open PRs: 0, open issues: 0. Last activity: 5d ago. Community health: 85%. Top contributors: sindresorhus, fisker, UltCombo, kevva, schnittstabil, marionebl, antongolub, BendingBender, fwouts, jamiekyle-eb and others.

·@ofershap

Replace github.com with gitshow.dev