{"name":"string-width","description":"Get the visual width of a string - the number of columns required to display it","dist-tags":{"latest":"5.1.2","version4":"4.2.3"},"versions":{"2.1.1":{"name":"string-width","version":"2.1.1","description":"Get the visual width of a string - the number of columns required to display it","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/string-width.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"dependencies":{"is-fullwidth-code-point":"^2.0.0","strip-ansi":"^4.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"74d8d552b465692790c41169b123409669d41079","bugs":{"url":"https://github.com/sindresorhus/string-width/issues"},"_id":"string-width@2.1.1","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","dist":{"integrity":"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==","shasum":"ab93f27a8dc13d28cac815c462143a6d9012ae9e","tarball":"http://localhost:4260/string-width/string-width-2.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0QEscnKyvRpCxyjflFgll2NLG0pHj7WTPBjB5r0nYJwIgNyVWMoOnZbXUI6QFF0f4gUgvOUU8VcxH2n0kkdADykA="}]},"directories":{}},"4.2.3":{"name":"string-width","version":"4.2.3","description":"Get the visual width of a string - the number of columns required to display it","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/string-width.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"dependencies":{"emoji-regex":"^8.0.0","is-fullwidth-code-point":"^3.0.0","strip-ansi":"^6.0.1"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"readme":"# string-width\n\n> Get the visual width of a string - the number of columns required to display it\n\nSome Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.\n\nUseful to be able to measure the actual width of command-line output.\n\n\n## Install\n\n```\n$ npm install string-width\n```\n\n\n## Usage\n\n```js\nconst stringWidth = require('string-width');\n\nstringWidth('a');\n//=> 1\n\nstringWidth('古');\n//=> 2\n\nstringWidth('\\u001B[1m古\\u001B[22m');\n//=> 2\n```\n\n\n## Related\n\n- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module\n- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string\n- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string\n\n\n---\n\n
\n\t\n\t\tGet professional support for this package with a Tidelift subscription\n\t\n\t
\n\t\n\t\tTidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.\n\t
\n
\n","readmeFilename":"readme.md","gitHead":"e7a2755c834246c59a4cc5de9471bef2d531a6b1","bugs":{"url":"https://github.com/sindresorhus/string-width/issues"},"_id":"string-width@4.2.3","_nodeVersion":"16.9.1","_npmVersion":"7.5.4","dist":{"integrity":"sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==","shasum":"269c7117d27b05ad2e536830a8ec895ef9c6d010","tarball":"http://localhost:4260/string-width/string-width-4.2.3.tgz","fileCount":5,"unpackedSize":5161,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdE8iSHW3j8YsH6u/KbZmvj9DtpGTXHmhmmp6oeUG6/AIge8jaI1Qk/Z/GED/SrwJ+yNQAEzkZ28FrbwLFqeAqdSg="}]},"directories":{},"_hasShrinkwrap":false},"5.1.2":{"name":"string-width","version":"5.1.2","description":"Get the visual width of a string - the number of columns required to display it","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/string-width.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"dependencies":{"eastasianwidth":"^0.2.0","emoji-regex":"^9.2.2","strip-ansi":"^7.0.1"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"types":"./index.d.ts","gitHead":"9f90691968ad356c807aaad1a5ed98d795749932","bugs":{"url":"https://github.com/sindresorhus/string-width/issues"},"_id":"string-width@5.1.2","_nodeVersion":"12.22.1","_npmVersion":"8.3.2","dist":{"integrity":"sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==","shasum":"14f8daec6d81e7221d2a357e668cab73bdbca794","tarball":"http://localhost:4260/string-width/string-width-5.1.2.tgz","fileCount":5,"unpackedSize":5781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHIYtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVLA/+M/8rKbhdnMv4nDBxBiwykx9T/GKuPldo2n9HpmPoqdaYbsUR\r\nKqB4g+cLAbMdr3kSMkt82Ou2Ceb8b23wBVNZbzYRQS+OKzzQKwwgi8PggU0t\r\niAm9V1k14zoV9r+hXKAG0MTp7+hEoqjjVYBEiz+z7TL5W0XR4c5iHBjUgNfg\r\n3G3flpdODgSZ4c5wgcODfSbEly/8GAh8hKzNNdYqgVVXLdPwzag4ArCP64TN\r\nBry4KwaNEguk3bqK0BGM4IZc3iz4bkZILEb5FgTUZuO2HbkBkNg0TD7rQz57\r\nTzzjnNJRzzF15NNijEVuuWj7BJBzEx7SUeZ6rBQbRAtMpZDgnYMjfnm1UOvs\r\nRLRaJt6phv/mYtLNVjW/Q5k8QAZHZr7aVAcOH314OFo1TopJwYfZfd8HdtVo\r\nYT2smUy2iVMs3KbHKQ+JKlnlA5u+x/0jv2eD4BvY1F2j86JHI8XoLT3JwYDS\r\nfZogtRhjGClSSyXyhihqkV/DlfeQxglZ7QFkAWlNt8xhUupzZ2fezqOX+15M\r\nimEdQ67SYm9akBBvxsbLvWaaMPlIdJW9fIspHwOKHctD00qjPmcwcJFKJAmt\r\noETedpGcdQHFko/wFjqSIeHThKrodnbWH5s/7C8c0Eie4Ran/NSihB4GSFgx\r\nlXX/hq0UhZhoc6EmR3kBXOealyRvPm0sA14=\r\n=ZoNR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFh4IjLA+aBQo7r/VZcidTSCApNLobLlmjMKnBREpog9AiEApke6FV5/3E44vAJKBbdIZ832/aqqaNMi8TFY+Px6Rwc="}]},"directories":{},"_hasShrinkwrap":false}},"readme":"# string-width\n\n> Get the visual width of a string - the number of columns required to display it\n\nSome Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.\n\nUseful to be able to measure the actual width of command-line output.\n\n## Install\n\n```\n$ npm install string-width\n```\n\n## Usage\n\n```js\nimport stringWidth from 'string-width';\n\nstringWidth('a');\n//=> 1\n\nstringWidth('古');\n//=> 2\n\nstringWidth('\\u001B[1m古\\u001B[22m');\n//=> 2\n```\n\n## API\n\n### stringWidth(string, options?)\n\n#### string\n\nType: `string`\n\nThe string to be counted.\n\n#### options\n\nType: `object`\n\n##### ambiguousIsNarrow\n\nType: `boolean`\\\nDefault: `false`\n\nCount [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2).\n\n## Related\n\n- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module\n- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string\n- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string\n\n---\n\n
\n\t\n\t\tGet professional support for this package with a Tidelift subscription\n\t\n\t
\n\t\n\t\tTidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.\n\t
\n
\n","homepage":"https://github.com/sindresorhus/string-width#readme","repository":{"type":"git","url":"git+https://github.com/sindresorhus/string-width.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/string-width/issues"},"license":"MIT","readmeFilename":"readme.md"}