Comparison with node-diacritics
Closed this issue · 3 comments
Hi @tyxla and thanks for this module! :)
I am curious about the differences you see between it and https://github.com/andrewrk/node-diacritics. What was your rationale for creating a new module? How can I choose between those two?
Cheers,
Matti
Hi @MattiSG,
This one was useful for me when I was building an internal project, and then I decided to release it as an open source project. As you can see, it does not have a ton of contributors yet.
The one you linked seems to be way better maintained though, so if it were me, I'd probably use it instead of mine :) I can see it takes a different approach when building the char maps, and it escapes the characters. Perhaps a quick benchmark of both tools would be a good way to determine which one to use.
Thanks for your interest :)
Thanks for your quick and straightforward reply! 😃
For the record, here was the result of my first analysis, just looking at the code:
andrewrk/node-diacritics
has more support, supports Unicode private range, and seems more resilient to encoding support, since the charmap is escaped. It is also probably more performant, since it doesn't do dynamic RegExes.
Too bad its name is not obvious if you haven't done accent-folding before…
But indeed, an actual benchmark would be the best to compare performance.
Thanks for opening up your code in any case!
I could look for any of these for potential improvement of this project in the near future. Thanks for sharing them with me! :)