{"name":"string-length","version":"3.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":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["unicode","string","length","size","count","astral","symbol","surrogates","codepoints","ansi","escape","codes"],"dependencies":{"astral-regex":"^1.0.0","strip-ansi":"^5.1.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.5.0","xo":"^0.24.0"},"gitHead":"c6c96299320f9b2707de2ac858c2210298219826","bugs":{"url":"https://github.com/sindresorhus/string-length/issues"},"homepage":"https://github.com/sindresorhus/string-length#readme","_id":"string-length@3.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-VeZa3u8MpEpDi7NMsZfp6ggk2x6ncBdE+sObPEVlczaUciCc+3ktm46P3HU2KdXArigN4XeEFNaj1Sg9TYAznw==","shasum":"74ae8d207c716322d4a8fe79736170d3b5a4ed94","tarball":"http://registry-npm.ywwl.com/string-length/download/string-length-3.0.0.tgz","fileCount":5,"unpackedSize":3606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj1NaCRA9TVsSAnZWagAAIj8QAICp1SooW059jCwp49DK\nQ2wPRMaIUKGNoAG6dg2/zF42if82Vec6kZDnJaIFXYNDeaAOVhjp+ffamj8M\ncKI1DeK4WbZhlAQfBLE015N+b0OkhLiAoZIgT6RtZDkIyRIAdSA2BAY5MzJ4\nqLFER+sJjWUZJ1rRw1t8tq5u0hNyLUlpuzo22Fq/vTt2dNuCYpWVc83XytZj\nOK4Q6gYEwqYtmDZR3k7LVPJiMW0Ey3Cb1av2DAMCDPoxmvhdM/2qWuxmhhO0\nOppmDG7uM5UJwW+YO4RwYRhy/fBrY+AqpkAbT8csfObjYxHi3hdwmvqNV7aD\nuy1GCTSo73RzDTRd43j9kyC7oO2mJWLgGhyJOqXgvVKv1iCkDFMxUPa5Jljf\nU2UkKA91wP+TNsxdgESYUgQidiW5XIiPhXgx1EfixL51pz2lzTKOBNozNkY5\nQybqrsnvuxoMc/u+t2US1ZD2S/zKNGIhOM7Tj3eE4uNy0KLyfQLNa3mLrqUj\nL1PUTwFKhD615M4uKSfu0Q3WbXm37UX/cI9cwUSUb0LSov38QOIPUotomVQR\ns9ZQ9dl3u0E1glI6wz5Qnguru7Ra5Dt1DCRCXypBXf3xM6f66bLCgNe3FD8C\nuJmzpv0Cw7wHWhS3hI/8ThdVhaBwiTPCP7+rnsGZEu7Ho78sA/vEAvi3+nqI\nzO5Y\r\n=LGLh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCS5maBx03R+w3uhDbX8yS3Ea0ZOyVRUVKeg9feNhtt9AIgCIG9FIrNOwEOOrz+1pOnxCQ9yqlNhQERVfOBlPMY2wI="}],"size":1777,"noattachment":false,"key":"/string-length/-/string-length-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/string-length_3.0.0_1552896857942_0.1703975027346425"},"_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":1552896858073,"_cnpm_publish_time":1552896858073,"dist-tags":{"latest":"7.0.1"}}