{"_id":"avip-string-length","name":"avip-string-length","dist-tags":{"latest":"4.0.2"},"versions":{"4.0.2":{"name":"avip-string-length","version":"4.0.2","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/anhhtvip/avip-string-length.git"},"homepage":"https://github.com/anhhtvip/avip-string-length","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["unicode","string","length","size","count","astral","symbol","surrogates","codepoints","ansi","escape","codes"],"dependencies":{"char-regex":"^1.0.2","strip-ansi":"^6.0.0","avip-string-decoder":"^1.1.1","avip-string-width":"^5.1.2"},"devDependencies":{"ava":"^3.1.0","tsd":"^0.11.0","xo":"^0.25.3"},"_id":"avip-string-length@4.0.2","gitHead":"9cfdb5ddef5b12207be80ff884e179506e28e756","types":"./index.d.ts","bugs":{"url":"https://github.com/anhhtvip/avip-string-length/issues"},"_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-SAH5FSGkz2x4DL2y3Rz5xwYPTUxNhjdLCzUH0371LcAUl63KA6TxNVROa3Br67JYgwimTkTxtCDSwMuGQ2WDsA==","shasum":"a735f2dc165ef4662a362a767abcb684b0543475","tarball":"https://registry.npmjs.org/avip-string-length/-/avip-string-length-4.0.2.tgz","fileCount":5,"unpackedSize":4320,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGPrfKMKbYdsNsW/Yl+meBCYxMKzUl/6vl1kcEmsa5+lAiEAmV6zg5D7jcy8rtWRYyIfvUZT8opeZRVmaEAivoQISSs="}]},"_npmUser":{"name":"anhhtvip","email":"anhhtvip@gmail.com"},"directories":{},"maintainers":[{"name":"anhhtvip","email":"anhhtvip@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/avip-string-length_4.0.2_1709461124224_0.3662906801647552"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-03T10:18:44.224Z","4.0.2":"2024-03-03T10:18:44.362Z","modified":"2024-03-03T10:18:45.256Z"},"maintainers":[{"name":"anhhtvip","email":"anhhtvip@gmail.com"}],"description":"Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes","homepage":"https://github.com/anhhtvip/avip-string-length","keywords":["unicode","string","length","size","count","astral","symbol","surrogates","codepoints","ansi","escape","codes"],"repository":{"type":"git","url":"git+https://github.com/anhhtvip/avip-string-length.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/anhhtvip/avip-string-length/issues"},"license":"MIT","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```\n$ npm install string-length\n```\n\n## Usage\n\n```js\nconst stringLength = require('string-length');\n\n'🐴'.length;\n//=> 2\n\nstringLength('🐴');\n//=> 1\n\nstringLength('\\u001B[1municorn\\u001B[22m');\n//=> 7\n```\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\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-string-length?utm_source=npm-string-length&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","readmeFilename":"readme.md"}