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
I can see no collaboration with @isaacs / minimatch on the path.matchesGlob() API, but I do see comments in the fs.glob issue (nodejs/node#40731 (comment)) and I do see that fs.glob (and as such path.matchesGlob()) wraps a bundled minimatch.
For existing users of minimatch: Would the recommendation be to stick with minimatch or to migrate to path.matchesGlob()?
The text was updated successfully, but these errors were encountered:
As I understand it, the path.matchesGlob() implementation is using minimatch more or less as-is from this repo. As it's very stable and hasn't gottten much changes except chores in quite a while that seems perfectly fine.
I don't intend to migrate the glob package (minimatch's most important consumer), for the simple reason that node core doesn't expose all of the Minimatch features that glob uses. And that's fine. I also still use rimraf and mkdirp in many places. (Mkdirp I've been gradually replacing with mkdir(path, { recursive: true }), but the rimraf package is quite a bit more robust at this point than node's rm(path, { recursive: true, force: true }).)
Glob and minimatch also support many node versions that did not include a minimatch implementation. But it might make sense for minimatch to use the built-in if it's available.
So, really, I don't have a strong feeling about it. Use whatever you like. If you have minimatch already in your tree, for some reason, for example because you're using glob, then it's fine to keep using it. fs.glob() is really not suitable for anything more than the most basic small-N use-cases, due to how it's implemented (as you saw me comment in the PR you linked to, no doubt). But if you want to save a dep, I mean, that's totally reasonable.
I see this question less as some sort of "debate" with an "answer" and more as just a shrug. Do whatever you like, it's OSS, it's fine. No reason to worry much one way or another about it.
Following a discussion on Twitter regarding nodejs/node#52779 / nodejs/node#52881 and whether it (or
fs.glob
, nodejs/node#51912 / nodejs/node#40731) competes with, complements or helps existing projects such asminimatch
I wanted to open an issue to get some kind of a public reference for it.I can see no collaboration with @isaacs /
minimatch
on thepath.matchesGlob()
API, but I do see comments in thefs.glob
issue (nodejs/node#40731 (comment)) and I do see thatfs.glob
(and as suchpath.matchesGlob()
) wraps a bundledminimatch
.For existing users of
minimatch
: Would the recommendation be to stick withminimatch
or to migrate topath.matchesGlob()
?The text was updated successfully, but these errors were encountered: