Skip to content

Drop fast-glob for tinyglobby #876

Closed

Description

@mathiasrw

A user wrote this to us.

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

Activity

  1. changed the title [-]Drop fast-glob for our own glob[/-] [+]Drop fast-glob for tinyglobby[/+] on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions