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

Symlinks are ignored #53

Closed aaronjensen closed 3 years ago

aaronjensen commented 3 years ago

Ideally, symlinks would be followable or this would be an option. At the moment, they are completely ignored:

https://github.com/thecodrr/fdir/blob/master/src/api/shared.js#L48-L54

This appears to be causing this downstream issue in snowpack: https://github.com/snowpackjs/snowpack/issues/2969

thecodrr commented 3 years ago

I am working on symlink support however it will affect performance greatly. It will be out and about soon though as an option withSymlinks probably.

aaronjensen commented 3 years ago

That's great, thank you.

DominikLevitsky commented 3 years ago

Just found this lib and I'm really interested in symlink support too! Any ETA on when can we expect it?

thecodrr commented 3 years ago

@DominikLevitsky I can't give an ETA but it is in the works. The main issue is implementing it safely and in a performant way. I will be posting updates here so hang on tight, it will be out in the next version for sure.

peterbe commented 3 years ago

I am working on symlink support however it will affect performance greatly. It will be out and about soon though as an option withSymlinks probably.

Would it still "affect performance greatly" if the root directory is a symlink? ...as opposed to starting a real directory but possible symlinks within.

thecodrr commented 3 years ago

@peterbe no, the performance penalty is only for symlink resolution. Afterwards, fdir will operate normally. I have a basic PoC ready which i'll be pushing for testing soon.

thecodrr commented 3 years ago

Symlinks support is almost done. Just have to benchmark the performance impact when withSymlinks is not there.

aaronjensen commented 3 years ago

Thanks!