{"_id":"string-width@8.3.0","bugs":{"url":"https://github.com/sindresorhus/string-width/issues"},"dist":{"shasum":"f1e85ca6d276ed9226c979c3651fb7abf548fbbe","tarball":"http://registry-npm.ywwl.com/string-width/download/string-width-8.3.0.tgz","fileCount":5,"integrity":"sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==","signatures":[{"sig":"MEYCIQD/p/T1oJ3fOPbbTbQiDaDCSfsjICE/27P9JsDpXgxmqAIhAKPn9HtHFEudgH46SlAbaN5lZ6pIyTbdp7JBeCVScA4+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCwCQS3QdeGW6RWtu2f0/n0mMBy2P0YM4wXBo/iStndFAIhAIfoJWE2TPMjBCYO1bsSDkCQpjF7Pv/QKbMkspuguqBe"}],"unpackedSize":11986,"size":4510,"noattachment":false,"key":"/string-width/-/string-width-8.3.0.tgz"},"name":"string-width","type":"module","types":"./index.d.ts","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"ffa1de3894af8f0471a86b60a624a3fd7a44580d","license":"MIT","scripts":{"test":"xo && ava && tsd"},"version":"8.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/sindresorhus/string-width#readme","keywords":["string","character","unicode","width","visual","column","columns","fullwidth","full-width","wcwidth","wcswidth","full","ansi","escape","codes","cli","command-line","terminal","console","cjk","chinese","japanese","korean","fixed-width","east-asian-width"],"repository":{"url":"git+https://github.com/sindresorhus/string-width.git","type":"git"},"_npmVersion":"12.0.1","description":"Get the visual width of a string - the number of columns required to display it","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.9.0","dependencies":{"strip-ansi":"^7.1.2","get-east-asian-width":"^1.5.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3","ava":"^6.4.1","tsd":"^0.33.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/string-width_8.3.0_1790260672138_0.19897500311784921"},"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 do not affect the width.\n\nUseful to be able to measure the actual width of command-line output.\n\n## Install\n\n```sh\nnpm 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: `true`\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> Ambiguous characters behave like wide or narrow characters depending on the context (language tag, script identification, associated font, source of data, or explicit markup; all can provide the context). **If the context cannot be established reliably, they should be treated as narrow characters by default.**\n> - http://www.unicode.org/reports/tr11/\n\n##### countAnsiEscapeCodes\n\nType: `boolean`\\\nDefault: `false`\n\nWhether [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) should be counted.\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- [get-east-asian-width](https://github.com/sindresorhus/get-east-asian-width) - Determine the East Asian Width of a Unicode character\n","publish_time":1790260672226,"_cnpm_publish_time":1790260672226,"dist-tags":{"latest":"9.0.0","version4":"4.2.3"}}