Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

utf8-length

substack142.9kMIT0.0.1

return the number of bytes in a unicode string

utf8, utf-8, unicode, bytes, byte, array, string, encoding

readme

utf8-length

return the number of bytes in a unicode string

build status

example

var bytes = require('utf8-length');
console.log(bytes('¡dooq dǝǝq'));

result:

$ node example/beep.js
13

methods

var bytes = require('utf8-length')

bytes(string)

Return the number of bytes needed to store string.

install

With npm do:

npm install utf8-bytes

license

MIT