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

Typescript support #33

Closed pl4yradam closed 4 years ago

pl4yradam commented 4 years ago

Will this package ever have typescript support?

depends on 'fdir'. CommonJS or AMD dependencies can cause optimization bailouts.
thecodrr commented 4 years ago

I haven't tried converting this to TypeScript as there's no reason to because there's already the index.d.ts file for type definitions and I don't have in mind to use any feature from TypeScript. Furthermore, I think that writing this in TypeScript might bring the performance down. Haven't tried it so can't be sure.

You are welcome to give it a try and if the performance remains the same or gets better, I might even merge it. I have no plans to bring TypeScript myself though.

Support for Deno might be in the plans.

pl4yradam commented 4 years ago

I understand. I will scrap the warnings that i get. It would be good if you can test the typescript equivilant. However because its compiled as commonjs it wont be seen as es standard.

On Thu, 2 Jul 2020, 15:43 Abdullah Atta, notifications@github.com wrote:

I haven't tried converting this to TypeScript as there's no reason to because there's already the index.d.ts file for type definitions and I don't have in mind to use any feature from TypeScript. Furthermore, I think that writing this in TypeScript might bring the performance down. Haven't tried it so can't be sure.

You are welcome to give it a try and if the performance remains the same or gets better, I might even merge it. I have no plans to bring TypeScript myself though.

Support for Deno might be in the plans.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thecodrr/fdir/issues/33#issuecomment-653047742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFL4VWX4P4XIKAKSKLJ2XGDRZSMHXANCNFSM4OO4K26Q .

thecodrr commented 4 years ago

It seems to me to be a lot of work for little benefit. At the end of the day, the code that is going to run on the Engine is still Javascript. I have carefully hand optimized each part of the code for maximum performance.

If I have extra time, I will surely look into it but no promises.

papb commented 4 years ago

I am not sure what is the issue here, the fact that index.d.ts already exists should be enough for most purposes... @pl4yradam can you be more clear on what is the issue you are facing?

thecodrr commented 4 years ago

Closing this as it seems unnecessary for now. If anyone thinks TypeScript can improve fdir in some way, feel free to comment below and I will reopen the issue.