String Width TS
The definitive Visual Width calculator.
Perfect alignment for Emojis, CJK, and ANSI codes.
Why your terminal output looks broken, and how to fix it.
❌ The Wrong Way
Name Age
古川 25 <-- Misaligned!
✅ The string-width-ts Way
Name Age
古川 25 <-- Perfect!
Comparison
| Feature | string-width-ts | string-width | wcwidth |
|---|---|---|---|
| TypeScript | ✅ Native | ⚠️ @types | ❌ No |
| Emoji Support | ✅ Advanced | ✅ Basic | ❌ No |
| String Manipulation | ✅ Pad/Truncate | ❌ No | ❌ No |
| Zero Dependencies | ✅ Yes | ❌ No | ❌ No |
Contribution
We welcome contributions to string-width-ts!
License
This project is free and open-source software licensed under the MIT License.
Copyright © 2025 Noor Mohammad
If this package saves you time, consider buying me a coffee.
Your support helps keep the utilities updated and well-documented. 🙏
💝 Thank you for your support!