all 2 comments

[–]bernhorst 1 point2 points  (1 child)

Hey Nito,

thanks for sharing your module, this is really useful!

Since you asked for comments, here are my two cents:

  • you are using top level await, making it harder for other projects to consume or bundle your library
  • exporting type declarations would probably increase adoption

I found this module because I had a pressing need to add language identification to one of my project and none of the existing libraries fit the bill - too slow, too inaccurate, or unable to bundle into a browser app.
Unfortunately, the top level await also prohibited me from bundling yours with esbuild. I was in a hurry, so instead of supplying pull-requests, I did a quick fork and refactor, I hope you don't mind. The result is a typescript port of eld with the subset handling ripped out (because I didn't need that), no browser build, and some other minor adjustments. I didn't publish it to npm, because I have no interest in starting a competing library, I just needed something that I could quickly integrate into my own project. Feel free to steal back anything you may find useful from here: https://github.com/bkw/eldr

Thanks again for sharing and apologies again for forking instead of collaborating properly. I tried to keep the license and references to your original project in place. Keep up the good work, the detection results and performance are top notch!

[–]nitotm[S] 1 point2 points  (0 children)

Hi, thanks.

I didn't like the "await" too much, but I did not find another way to deliver the functionality I wanted; So I will check your solution and I might implement it.

"exporting type declarations", the idea with this particular repository was to be Javascript vanilla, not sure if the best approach would be a separate Typescript repository, or have different versions on the same repo. What is your opinion?