{"_id":"string-width@9.0.0","bugs":{"url":"https://github.com/sindresorhus/string-width/issues"},"dist":{"shasum":"c73ae65bd89657fcfbd05e3e6f80c5d801a8e6d5","tarball":"http://registry-npm.ywwl.com/string-width/download/string-width-9.0.0.tgz","fileCount":5,"integrity":"sha512-2MOboAIRIszVGZVPA2Zqwj0ujd0o+xAZ5y2ft4OcD4kuVQ4phZxq0Sv7YTY8yaDA2CSMXch1EWTkJw+tTJZTzA==","signatures":[{"sig":"MEUCIQDgteAwcujj2xGNVtTaixzxXYEhv2BMpYEYfI27C/AZFgIgIJo+Rom9mTsV9tQ8SZ583Jp8FuuN+eTyvBQ1REJasfM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC4W5YjGxpmhxAYT5fJduD3MaMsm/aiIV1Ek3A+yAuPYAiAbQErU+QZJ4b1Nh+FYPKy3b5w8NdIFrN6oTplPm56utg=="}],"unpackedSize":17209,"size":6438,"noattachment":false,"key":"/string-width/-/string-width-9.0.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":">=22"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"3082bffe020ae22b11b7288bb831a9cf0fd82d69","license":"MIT","scripts":{"test":"xo && node --test"},"version":"9.0.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.2.0","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.12.1","dependencies":{"strip-ansi":"^7.2.0","get-east-asian-width":"^1.7.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^5.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/string-width_9.0.0_1794414757532_0.8412709813697284"},"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> - https://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":1794414757637,"_cnpm_publish_time":1794414757637,"dist-tags":{"latest":"9.0.0","version4":"4.2.3"}}