https://github.com/mrozio13pl/wcwidth
Port of C's wcwidth.
https://github.com/mrozio13pl/wcwidth
javascript npm wcwidth
Last synced: about 1 month ago
JSON representation
Port of C's wcwidth.
- Host: GitHub
- URL: https://github.com/mrozio13pl/wcwidth
- Owner: mrozio13pl
- License: mit
- Created: 2023-12-24T15:00:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-24T15:02:43.000Z (over 2 years ago)
- Last Synced: 2025-08-08T19:54:41.876Z (10 months ago)
- Topics: javascript, npm, wcwidth
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@mrozio/wcwidth
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- License: license
Awesome Lists containing this project
README
# wcwidth [](https://npm.im/@mrozio/wcwidth)
Dead simple, tiny (`~2.3 kB`) port of [wcwidth](https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c) implemented in C by Markus Kuhn.
```bash
npm i @mrozio/wcwidth
```
```ts
import { wcwidth, wcswidth } from '@mrozio/wcwidth';
'嘿'.length; // <= 1
wcwidth('嘿'.charCodeAt()); // <= 2
'我讨厌 JavaScript'.length; // <= 14
wcswidth('我讨厌 JavaScript'); // <= 17
```
## License
MIT 💖