Byte-Length
Calculate the real byte length of any string.
Why
In node many will use Buffer.byteLength
, however including the entire buffer shim in the browser just for getting the byte length of a string is not very conservative.
Installation
npm install byte-length
Example
; ; //-> 5; //-> 4; //-> 60
Contributions
- Use
npm test
to run tests.
Please feel free to create a PR!