{"_id":"get-east-asian-width","_rev":"6-06e187e6dc411fd00c5a806d57bf0fcd","name":"get-east-asian-width","dist-tags":{"latest":"1.4.0"},"versions":{"1.0.0":{"name":"get-east-asian-width","version":"1.0.0","keywords":["unicode","east-asian-width","eastasianwidth","character","string","width","text","layout","alignment","fullwidth","halfwidth","ambiguous","narrow","wide","neutral","typography","japanese","chinese","korean","codepoint","text-processing","i18n","l10n"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"get-east-asian-width@1.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/get-east-asian-width#readme","bugs":{"url":"https://github.com/sindresorhus/get-east-asian-width/issues"},"xo":{"ignores":["lookup.js"]},"dist":{"shasum":"762072a7df71098c225ac9d239c95f117e507128","tarball":"https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.0.0.tgz","fileCount":6,"integrity":"sha512-7estWZOk4GUviMbLupPCsHePNHS7fCt6yLzBv43f8Z64xRBgoOsfdDaRuT+BU6Hq2jWsKNmvxCbxo664fxEPcA==","signatures":[{"sig":"MEYCIQCTlfdIMwaP3zuXbYMOR//F9sGNPGASU6LxSsZ0RNzV+gIhAJBtnoT7zqLhsESElBElN2YJSQ240/z0a+Nh39kAxvV3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41541},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"367c6645473bcce36c6c812081427c5cf78edcea","scripts":{"test":"xo && ava && tsc index.d.ts","build":"node scripts/build.js","prepublish":"npm run build"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/get-east-asian-width.git","type":"git"},"_npmVersion":"9.2.0","description":"Determine the East Asian Width of a Unicode character","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","typescript":"^5.2.2","simplify-ranges":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/get-east-asian-width_1.0.0_1698494653026_0.6852380542237115","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"get-east-asian-width","version":"1.1.0","keywords":["unicode","east-asian-width","eastasianwidth","character","string","width","text","layout","alignment","fullwidth","halfwidth","ambiguous","narrow","wide","neutral","typography","japanese","chinese","korean","codepoint","text-processing","i18n","l10n"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"get-east-asian-width@1.1.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/get-east-asian-width#readme","bugs":{"url":"https://github.com/sindresorhus/get-east-asian-width/issues"},"xo":{"ignores":["lookup.js"]},"dist":{"shasum":"c37e1eb4346ab41cccd76c3eedac5c31f825f8f8","tarball":"https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.1.0.tgz","fileCount":6,"integrity":"sha512-wwCniIDC9zyk951YonbBUjVfPhatId4PEO5WJAZsBOhD+fbu3A73uxy8fR9O31ca62siJi/QEJguFPvTJ901Pw==","signatures":[{"sig":"MEQCIBdqFrj+Lqg+jSjsrdU6GTNbozAbYOkaBN+TSsV9/aHKAiAqdrosmxBO0dQ5bqSJnnMPilZc3KIADnTMMcB3jBEdHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15146},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"0ab1462b12c2fd39515accaaaa54f07007304102","scripts":{"test":"xo && ava && tsc index.d.ts","build":"node scripts/build.js","prepublish":"npm run build"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/get-east-asian-width.git","type":"git"},"_npmVersion":"9.2.0","description":"Determine the East Asian Width of a Unicode character","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","outdent":"^0.8.0","typescript":"^5.2.2","indent-string":"^5.0.0","simplify-ranges":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/get-east-asian-width_1.1.0_1698585603953_0.5432821755832502","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"get-east-asian-width","version":"1.2.0","keywords":["unicode","east-asian-width","eastasianwidth","character","string","width","text","layout","alignment","fullwidth","halfwidth","ambiguous","narrow","wide","neutral","typography","japanese","chinese","korean","codepoint","text-processing","i18n","l10n"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"get-east-asian-width@1.2.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/get-east-asian-width#readme","bugs":{"url":"https://github.com/sindresorhus/get-east-asian-width/issues"},"xo":{"ignores":["lookup.js"]},"dist":{"shasum":"5e6ebd9baee6fb8b7b6bd505221065f0cd91f64e","tarball":"https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz","fileCount":6,"integrity":"sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==","signatures":[{"sig":"MEYCIQDx9T+XHE7tsg7nVP4+HrR22kcxCyRN3Ub8ZrNkeGmnDwIhAI8QI8fTiwFSc37zokXiR9NYaKgFeRCvdK9YytLGUD1q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15599},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"8b6a63bed875c0f6c5683967a2360fd14dba7b80","scripts":{"test":"xo && ava && tsc index.d.ts","build":"node scripts/build.js","prepublish":"npm run build"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/get-east-asian-width.git","type":"git"},"_npmVersion":"9.2.0","description":"Determine the East Asian Width of a Unicode character","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","outdent":"^0.8.0","typescript":"^5.2.2","indent-string":"^5.0.0","simplify-ranges":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/get-east-asian-width_1.2.0_1698595456827_0.39333670603250437","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"get-east-asian-width","version":"1.3.0","keywords":["unicode","east-asian-width","eastasianwidth","character","string","width","text","layout","alignment","fullwidth","halfwidth","ambiguous","narrow","wide","neutral","typography","japanese","chinese","korean","codepoint","text-processing","i18n","l10n"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"get-east-asian-width@1.3.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/get-east-asian-width#readme","bugs":{"url":"https://github.com/sindresorhus/get-east-asian-width/issues"},"xo":{"ignores":["lookup.js"]},"dist":{"shasum":"21b4071ee58ed04ee0db653371b55b4299875389","tarball":"https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz","fileCount":6,"integrity":"sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==","signatures":[{"sig":"MEUCIQDwwAfs1PLyCOWpYMus3ha5+B+tGC8OB1ZL8CCHm//1YgIgRAdgZt5IyTjj24lOBx1PXjJsquGVhxFxrtvIF0GA1mg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15688},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"12a8e4594101f08250c009740763b3b70aef7c63","scripts":{"test":"xo && ava && tsc index.d.ts","build":"node scripts/build.js","prepublish":"npm run build"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/get-east-asian-width.git","type":"git"},"_npmVersion":"10.6.0","description":"Determine the East Asian Width of a Unicode character","directories":{},"sideEffects":false,"_nodeVersion":"22.6.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","outdent":"^0.8.0","typescript":"^5.2.2","indent-string":"^5.0.0","simplify-ranges":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/get-east-asian-width_1.3.0_1728839439178_0.4726763557382587","host":"s3://npm-registry-packages"}},"1.3.1":{"name":"get-east-asian-width","version":"1.3.1","keywords":["unicode","east-asian-width","eastasianwidth","character","string","width","text","layout","alignment","fullwidth","halfwidth","ambiguous","narrow","wide","neutral","typography","japanese","chinese","korean","codepoint","text-processing","i18n","l10n"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"get-east-asian-width@1.3.1","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/get-east-asian-width#readme","bugs":{"url":"https://github.com/sindresorhus/get-east-asian-width/issues"},"xo":{"ignores":["lookup.js"]},"dist":{"shasum":"b85889d779881a651dfde71d3796ddbe9549012b","tarball":"https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.1.tgz","fileCount":6,"integrity":"sha512-R1QfovbPsKmosqTnPoRFiJ7CF9MLRgb53ChvMZm+r4p76/+8yKDy17qLL2PKInORy2RkZZekuK0efYgmzTkXyQ==","signatures":[{"sig":"MEYCIQDCH65K/T6Z/swyhtjEL51cSchTyqhm4GzurMt1zNM8bwIhALtS42zLqc4e0eMFWZkkwXAS3/PGdhvJgWYp5g4RmCwO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15604},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"1b7c37974f3b0b8af7c5dd145b486a0543b9f2fc","scripts":{"test":"xo && ava && tsc index.d.ts","build":"node scripts/build.js","prepublish":"npm run build"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/get-east-asian-width.git","type":"git"},"_npmVersion":"10.9.2","description":"Determine the East Asian Width of a Unicode character","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","outdent":"^0.8.0","typescript":"^5.2.2","indent-string":"^5.0.0","simplify-ranges":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/get-east-asian-width_1.3.1_1756562884149_0.6845505557918499","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"get-east-asian-width","version":"1.4.0","description":"Determine the East Asian Width of a Unicode character","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/get-east-asian-width.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts","build":"node scripts/build.js","prepublish":"npm run build"},"keywords":["unicode","east-asian-width","eastasianwidth","character","string","width","text","layout","alignment","fullwidth","halfwidth","ambiguous","narrow","wide","neutral","typography","japanese","chinese","korean","codepoint","text-processing","i18n","l10n"],"devDependencies":{"ava":"^5.3.1","indent-string":"^5.0.0","outdent":"^0.8.0","simplify-ranges":"^0.1.0","typescript":"^5.2.2","xo":"^0.56.0"},"xo":{"ignores":["lookup.js"]},"_id":"get-east-asian-width@1.4.0","gitHead":"e0e3490e63d12f4ee8aa03eaf53063f1f4b9420d","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/get-east-asian-width/issues"},"homepage":"https://github.com/sindresorhus/get-east-asian-width#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==","shasum":"9bc4caa131702b4b61729cb7e42735bc550c9ee6","tarball":"https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz","fileCount":6,"unpackedSize":15619,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHdTKnW0I48aW5bNtu5+sWY3Ze9RO6Vw67FeM8xW2ywnAiA7hWSQtLAlLcD2GikI/gj6rVFXCxLs4mhKIB5y8WNv4A=="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/get-east-asian-width_1.4.0_1757446564336_0.20175822532241883"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-28T12:04:13.026Z","modified":"2025-09-09T19:36:04.694Z","1.0.0":"2023-10-28T12:04:13.231Z","1.1.0":"2023-10-29T13:20:04.140Z","1.2.0":"2023-10-29T16:04:16.978Z","1.3.0":"2024-10-13T17:10:39.347Z","1.3.1":"2025-08-30T14:08:04.338Z","1.4.0":"2025-09-09T19:36:04.523Z"},"bugs":{"url":"https://github.com/sindresorhus/get-east-asian-width/issues"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/get-east-asian-width#readme","keywords":["unicode","east-asian-width","eastasianwidth","character","string","width","text","layout","alignment","fullwidth","halfwidth","ambiguous","narrow","wide","neutral","typography","japanese","chinese","korean","codepoint","text-processing","i18n","l10n"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/get-east-asian-width.git"},"description":"Determine the East Asian Width of a Unicode character","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"readme":"# get-east-asian-width\n\n> Determine the [East Asian Width](https://unicode.org/reports/tr11/) of a Unicode character\n\n> East Asian Width categorizes Unicode characters based on their occupied space in East Asian typography, which helps in text layout and alignment, particularly in languages like Japanese, Chinese, and Korean.\n\nUnlike other similar packages, this package uses the latest Unicode data (which changes each year).\n\n## Install\n\n```sh\nnpm install get-east-asian-width\n```\n\n## Usage\n\n```js\nimport {eastAsianWidth, eastAsianWidthType} from 'get-east-asian-width';\n\nconst codePoint = '字'.codePointAt(0);\n\nconsole.log(eastAsianWidth(codePoint));\n//=> 2\n\nconsole.log(eastAsianWidthType(codePoint));\n//=> 'wide'\n```\n\n## `eastAsianWidth(codePoint: number, options?: object): 1 | 2`\n\nReturns the width as a number for the given code point.\n\n### options\n\nType: `object`\n\n#### ambiguousAsWide\n\nType: `boolean`\\\nDefault: `false`\n\nWhether to treat an `'ambiguous'` character as wide.\n\n```js\nimport {eastAsianWidth} from 'get-east-asian-width';\n\nconst codePoint = '⛣'.codePointAt(0);\n\nconsole.log(eastAsianWidth(codePoint));\n//=> 1\n\nconsole.log(eastAsianWidth(codePoint, {ambiguousAsWide: true}));\n//=> 2\n```\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## `eastAsianWidthType(codePoint: number): 'fullwidth' | 'halfwidth' | 'wide' | 'narrow' | 'neutral' | 'ambiguous'`\n\nReturns the type of “East Asian Width” for the given code point.\n\n## Related\n\n- [string-width](https://github.com/sindresorhus/string-width) - Get the visual width of a string\n","readmeFilename":"readme.md"}