napi-rs / node-rs

Node.js bindings ❤️ Rust crates
https://node-rs.dev
MIT License
1.03k stars 32 forks source link

Feature Request: ICU4C Library #785

Open mustafa519 opened 4 months ago

mustafa519 commented 4 months ago

Hello!

I've just found this repo is amazing that we can use the fastest implementations of the popular packages with the almost same API. Thank you for providing your valuable efforts.

I've moved from PHP to node.js recently. There is something missing very important for me in node.js. The ICU4C Library. Node has the Intl library however it doesn't help to implement something customized in node's intl especially on the text based transliterators.

I had been using PHP's intl in the past. Surprisingly there are no any alternatives in node.js ecosystem which is a very big gap that needs to be filled.

E.g. customized requirement which was in PHP:

$string = \Transliterator::createFromRules(
  ':: NFD [^\.\-\'\,\&\+];'
  . ':: NFC;'
  . ':: Latin-ASCII [^\.\-\'\,\&\+];'
  . ':: [\u0080-\u7fff] Remove;'
  . ':: [:Punctuation:] Remove;'
  . '[:Separator:] > '\s'
)->transliterate($string);

I've shared the PHP example because I think it has the easiest API design that I've seen.

I am so poor at the low level things like rust or c/c++. Is it possible to port it from c,c++,rust to node.js? Or it requires too much effort? Or do you accept a new feature request within your roadmap?

There is a rust port(by google) that may help if it's possible to add it to bindings?

Lastly, there are many packages that they try text to slugify that they are not capable enough to work with all the languages. And people are still suffering due to limited support or separated packages.

Is it possible?

Mustafa, Thanks!