thecodrr / fdir

⚡ The fastest directory crawler & globbing library for NodeJS. Crawls 1m files in < 1s
https://thecodrr.github.io/fdir/
MIT License
1.51k stars 58 forks source link

[Feature] glob/crawl by symlink path, not real path #83

Closed IanVS closed 2 years ago

IanVS commented 2 years ago

As noted in https://github.com/thecodrr/fdir/issues/23#issuecomment-1281810844, currently globs match against resolved symlink paths, not the symlink paths themselves. This is a bit counter-intuitive, and I think that the symlink paths should be matched and returned instead, perhaps with an option to return real paths instead.

thecodrr commented 2 years ago

WIP at #84

thecodrr commented 2 years ago

@IanVS can you test against master branch and see if that works for you?

IanVS commented 2 years ago

Yep, I copied over the src from master and it's now working correctly! Thanks!

thecodrr commented 2 years ago

Will release v5.3.0 then

thecodrr commented 2 years ago

@IanVS done. I changed the API a bit to be backwards compatible with v5 so check the docs to see how you can use it.

IanVS commented 2 years ago

Thanks. One small piece of unsolicited feedback, is that this might fall into the boolean trap. When reading .withSymlinks(false) it could reasonably be thought that symlinks are disabled. An API like .withSymlinks({ resolve: boolean }) gives a bit more clarity, IMHO. But, that's just my own two cents. Thanks again for getting this released so quickly!

thecodrr commented 2 years ago

One small piece of unsolicited feedback, is that this might fall into the boolean trap.

I agree. I'll be making some breaking changes in v6.0 so this API is definitely not final. There's a lot of confusion in the current exposed methods so I will do some much needed renaming as well.

SuperchupuDev commented 3 months ago

@thecodrr it looks like this feature was silently removed in the typescript rewrite? i've opened #104 to add it back