Sha256: 8c5727a6b5108479e28c63126894f3c932dc526f24a1448e905d53edbb1bde60
Contents?: true
Size: 682 Bytes
Versions: 63
Compression:
Stored size: 682 Bytes
Contents
# string-length [](https://travis-ci.org/sindresorhus/string-length) > Get the real length of a string - by correctly counting astral symbols and ignoring [ansi escape codes](https://github.com/sindresorhus/strip-ansi) `String#length` errornously counts [astral symbols](http://www.tlg.uci.edu/~opoudjis/unicode/unicode_astral.html) as two characters. ## Install ``` $ npm install --save string-length ``` ## Usage ```js '🐴'.length; //=> 2 stringLength('🐴'); //=> 1 stringLength('\u001b[1municorn\u001b[22m'); //=> 7 ``` ## License MIT © [Sindre Sorhus](http://sindresorhus.com)
Version data entries
63 entries across 63 versions & 2 rubygems