{"name":"string-length","version":"2.0.0","description":"Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/string-length.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["unicode","string","length","size","count","astral","symbol","surrogates","codepoints","ansi","escape","codes"],"dependencies":{"astral-regex":"^1.0.0","strip-ansi":"^4.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"dcdf2d91dcb155923ece3b8f77f2279e49bb1d3f","bugs":{"url":"https://github.com/sindresorhus/string-length/issues"},"homepage":"https://github.com/sindresorhus/string-length#readme","_id":"string-length@2.0.0","_shasum":"d40dbb686a3ace960c1cffca562bf2c45f8363ed","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d40dbb686a3ace960c1cffca562bf2c45f8363ed","tarball":"http://registry-npm.ywwl.com/string-length/download/string-length-2.0.0.tgz","integrity":"sha512-Qka42GGrS8Mm3SZ+7cH8UXiIWI867/b/Z/feQSpQx/rbfB8UGknGEZVaUQMOUVj+soY6NpWAxily63HI1OckVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJ50xiVzXofoZUDit69ZBX06aW2SiZlbYFkuETHM2OvwIhAL671lsZsFR39goHYgJhDYG6KzzwYjuybHqfG+mlTWq1"}],"size":1651,"noattachment":false,"key":"/string-length/-/string-length-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-length-2.0.0.tgz_1501117430278_0.7992605706676841"},"directories":{},"readme":"# string-length\n\n> Get the real length of a string - by correctly counting astral symbols and ignoring [ansi escape codes](https://github.com/sindresorhus/strip-ansi)\n\n`String#length` erroneously counts [astral symbols](https://web.archive.org/web/20150721114550/http://www.tlg.uci.edu/~opoudjis/unicode/unicode_astral.html) as two characters.\n\n## Install\n\n```sh\nnpm install string-length\n```\n\n## Usage\n\n```js\nimport stringLength from 'string-length';\n\n'🐴'.length;\n//=> 2\n\nstringLength('🐴');\n//=> 1\n\nstringLength('\\u001B[1municorn\\u001B[22m');\n//=> 7\n```\n\n## API\n\n### stringLength(string, options?)\n\n#### options\n\nType: `object`\n\n##### countAnsiEscapeCodes\n\nType: `boolean`\\\nDefault: `false`\n\nWhether [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) should be counted. They are ignored by default.\n\n## Related\n\n- [string-length-cli](https://github.com/LitoMore/string-length-cli) - CLI for this module\n- [string-width](https://github.com/sindresorhus/string-width) - Get visual width of a string\n","publish_time":1501117431257,"_cnpm_publish_time":1501117431257,"dist-tags":{"latest":"7.0.1"}}