{"name":"string-length","version":"7.0.0","keywords":["unicode","string","length","size","count","astral","symbol","surrogates","codepoints","ansi","escape","codes"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"string-length@7.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/string-length#readme","bugs":{"url":"https://github.com/sindresorhus/string-length/issues"},"dist":{"shasum":"7fc97a5dc794b65987ba0ab4d7e2062314f368b9","tarball":"http://registry-npm.ywwl.com/string-length/download/string-length-7.0.0.tgz","fileCount":5,"integrity":"sha512-ydQ8585Cd5u+dzKw3s3bsUJgd+JtmUZMnHLSj36SxdKckrE4K1n25ZMf32ZpSAUmmnF00xwhzp4lv2t12WAE6g==","signatures":[{"sig":"MEUCIQDNjeeQ7Pjf7Hs2y548pBHHEZ+5nSXDsuRlNC2r/aBZ2wIgcIYFAAshH4pkdj1cfawbHPGRKrc2DFapVSNrmot/HCg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4278,"size":2005,"noattachment":false,"key":"/string-length/-/string-length-7.0.0.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"f67ad3db7575645395e2def63ae4b4631c06eabe","scripts":{"test":"xo && ava"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/string-length.git","type":"git"},"_npmVersion":"11.7.0","description":"Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes","directories":{},"sideEffects":false,"_nodeVersion":"25.3.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1"},"_npmOperationalInternal":{"tmp":"tmp/string-length_7.0.0_1768964026600_0.3254909190377737","host":"s3://npm-registry-packages-npm-production"},"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":1768964026773,"_cnpm_publish_time":1768964026773,"dist-tags":{"latest":"7.0.1"}}