4 ms·
This here looks wrong: https://github.com/thecodrr/fdir/blob/master/index.js#L86 https://github.com/thecodrr/fdir/blob/master/index.js#L86 It's calling a blocki
by lhorie 7y ago
This here looks wrong: https://github.com/thecodrr/fdir/blob/master/index.js#L86 https://github.com/thecodrr/fdir/blob/master/index.js#L86
It's calling a blocking method from async in Node <10
Another thing I noticed, it looks you only handle `dirent.isDirectory()`, but not `dirent.isSymbolicLink()` (meaning the library won't find files in symlinked folders, e.g. lerna node_modules)
- 29athrowaway 7y ago> Because they did not spend enough time optimizing it. Most developers give readability and cool code more importance than actual performance and usability. Aged like milk.
- thecodrr 7y agoHey, thanks for taking the interest. Yes, that sync method call is intentional (for now) +. I have been meaning to add separate lstat call for async/sync for < node 10 without impacting performance. So that will change. Thanks for pointing that out. Handling symlinks is work in progress. (it will be exposed as an option that you can enable/disable because symlinks resolution is expensive and not everyone wants that).
- mrtweetyhack 7y agoI don't mind it not lookat at symlinks; how about an option to enable it