{"name":"string-length","version":"3.1.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":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["unicode","string","length","size","count","astral","symbol","surrogates","codepoints","ansi","escape","codes"],"dependencies":{"astral-regex":"^1.0.0","strip-ansi":"^5.2.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"083c3ae16f416b9b51ab5d1a6763ca883ab94806","bugs":{"url":"https://github.com/sindresorhus/string-length/issues"},"homepage":"https://github.com/sindresorhus/string-length#readme","_id":"string-length@3.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA==","shasum":"107ef8c23456e187a8abd4a61162ff4ac6e25837","tarball":"http://registry-npm.ywwl.com/string-length/download/string-length-3.1.0.tgz","fileCount":5,"unpackedSize":3886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcosqLCRA9TVsSAnZWagAAfz8P/2VKDarayTFywfgo43OL\nSrJX2coUS2QEtLmVp8N072fmjxFgvbPZ/bkUgVqZqeD4YEl+kl4uUwhRIlA0\nvLc2fZL1oBKQjqMANkdzN/4CoW93Wc3XodoR01KxUk3cetOlmlrMtdV+VWQO\n3wjeH1YsNgYCafmeU12MReWgPCSbac3TCcrKUHOWlWUO4ieKhJidl9iiV8RN\n74alhuCzhVnyjTpfoPKvxyMOC5LOS95UcTws3T9yy2IUgoSVby0g/TqDFuNj\nApWIIlf0tHWZR2tcSB21lEXfdsdZGOqDUPywmgG84f1OCTIb4uD+tzOb1YUU\nP9aaigq6e99dqAOqV27Lvx/2gbsfeVoMc1K041YoAEYWJD0cKffRrwkg8FYs\nAtvMFJ/lrCIe86Hv13M/HAS/mgp16W7FYtgaNIspeW8+8hD/L3th1suFl9qs\nJwylYOUYVDVGWKLvTFatrSk1XvD/DDzIFqUu8r++8ONOeyEFqbDc0VIpHd9Z\norN3tNM2mWWeu+o8HcBe4lkWsXsBpATo8JsBv1XZ7oQIQc/fl49Uw484yWP6\nmNDTzbKBol2IlVdnwEFkyrhjaibBG2iQKO5oQIZuClB5tbKB7Fcy+mQHGErD\nZlI9EJo/nbQu2wosCkez0AjdWFjQuqVZc2M+e7bx0H+PkYWolZZ+Vs2j2Go9\nb18I\r\n=oJfb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr68ajAWehV4sWjCzfzTJkowflU0EJXVM9VuoSh4rxqgIhANxoemj2WXRw2R38djqeCX+K06S23HbA1Uazl0aBSWd9"}],"size":1872,"noattachment":false,"key":"/string-length/-/string-length-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-length_3.1.0_1554172554425_0.292397781999574"},"_hasShrinkwrap":false,"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":1554172554651,"_cnpm_publish_time":1554172554651,"dist-tags":{"latest":"7.0.1"}}