return the number of bytes in a unicode string
JavaScript
Latest commit f36134c Dec 9, 2013 @substack fix the safari version
Permalink
Failed to load latest commit information.
example example works Nov 29, 2013
test fix the tests Nov 29, 2013
.travis.yml travis Nov 29, 2013
LICENSE package.json etc Nov 29, 2013
index.js Use @mathiasbynens' astral-safe version Nov 29, 2013
package.json fix the safari version Dec 9, 2013
readme.markdown added testling badge Nov 30, 2013

readme.markdown

utf8-length

return the number of bytes in a unicode string

build status

browser support

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