You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you ever want a slimmer rexreplace, fast-glob is its heaviest dependency, with 16 packages in our lockfile. You could replace it with a smaller glob package, or with Node's own fs.globSync if you drop Node versions older than 22. That's optional and has nothing to do with these alerts.
We keep supporting Node down to 16 (#872), so fs.globSync alone is not enough, and it has no case insensitive matching and does not take ! in the list of patterns. tinyglobby does what rr needs with 3 packages in place of 16 (tinyglobby, fdir and picomatch), and runs on Node 12 and later.
What rr needs from a glob
fast-glob
tinyglobby
*, **, ?, [...] and {a,b}
yes
yes
A pattern that starts with ! takes files away from the others (--exclude-glob relies on it)
yes
yes
Case insensitive by default, and case sensitive with -I (#716)
caseSensitiveMatch
caseSensitiveMatch
Only files, and no dot files unless the glob names them
yes
yes
A folder name, like sub, finds nothing
yes
only with expandDirectories: false, else it finds every file in the folder
A folder that can not be read is an error, and the run goes on (#788)
throws EACCES
skips it without a word, and has no option to throw
Gaps to close
expandDirectories: false must be set, or a folder name changes every file in that folder.
The error for a folder that can not be read must not be lost. tinyglobby takes an fs option, so our own readdirSync can see the error and report it.
Breaking
--js gives the code globs, which is fast-glob. It becomes tinyglobby, with sync kept as an alias of globSync, so code that uses globs.sync keeps working. Options of fast-glob that tinyglobby does not have are ignored. This goes in the v8 release note.
Done when
fast-glob is gone from package.json and the lockfile
The tests of globs pass on Node 16 to 26 and on Bun
Activity
[-]Drop fast-glob for our own glob[/-][+]Drop fast-glob for tinyglobby[/+]