Top
Best
New

Posted by dawson0 7 hours ago

Show HN: wcwidth-o1 – Find Unicode text cell width in no time for JavaScript/TS(github.com)
I ported Markus Kuhn’s wcwidth to TypeScript and optimized it with bitset lookups for O(1) performance. It now covers the full Unicode 15.1 combining ranges.

GitHub: https://github.com/dawsonhuang0/Wcwidth-O1 NPM: https://www.npmjs.com/package/wcwidth-o1

Feedback welcome!

14 points | 3 comments
jv22222 4 hours ago|
I was about to say you could figure this kind of thing out with Intl.Segmenter but then saw it was a different problem. Nice.
shawn_w 2 hours ago||
Now you just have to update it to the just-released Unicode 17.
peter-m80 5 hours ago|
Nice