huanggang 03a863fb53 add node_modules il y a 8 ans
..
index.js 03a863fb53 add node_modules il y a 8 ans
license 03a863fb53 add node_modules il y a 8 ans
package.json 03a863fb53 add node_modules il y a 8 ans
readme.md 03a863fb53 add node_modules il y a 8 ans

readme.md

string-length Build Status

Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes

String#length errornously counts astral symbols as two characters.

Install

$ npm install --save string-length

Usage

'🐴'.length;
//=> 2

stringLength('🐴');
//=> 1

stringLength('\u001b[1municorn\u001b[22m');
//=> 7

License

MIT © Sindre Sorhus