jack e1a2621c78 update | 2 лет назад | |
---|---|---|
.. | ||
index.js | 2 лет назад | |
license | 2 лет назад | |
package.json | 2 лет назад | |
readme.md | 2 лет назад |
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.
$ npm install --save string-length
'🐴'.length;
//=> 2
stringLength('🐴');
//=> 1
stringLength('\u001b[1municorn\u001b[22m');
//=> 7
MIT © Sindre Sorhus