# eastasianwidth

> Get East Asian Width from a character.

Latest version **0.3.0** (published 2024-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install eastasianwidth
pnpm add eastasianwidth
yarn add eastasianwidth
bun add eastasianwidth
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2024-04-21 |
| First published | 2013-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 93 |
| Author | Masaki Komagata |
| Maintainers | komagata |

## Links

- npm: https://www.npmjs.com/package/eastasianwidth
- Repository: https://github.com/komagata/eastasianwidth
- Homepage: https://github.com/komagata/eastasianwidth#readme
- Issues: https://github.com/komagata/eastasianwidth/issues
- npm.io page: https://npm.io/package/eastasianwidth

## Recent versions

- 0.3.0 (latest) — 2024-04-21
- 0.2.0 — 2018-01-01
- 0.1.1 — 2015-09-26
- 0.1.0 — 2013-05-02
- 0.0.1 — 2013-03-30

## README

# East Asian Width

Get [East Asian Width](http://www.unicode.org/reports/tr11/) from a character.

'F'(Fullwidth), 'H'(Halfwidth), 'W'(Wide), 'Na'(Narrow), 'A'(Ambiguous) or 'N'(Natural).

Original Code is [東アジアの文字幅 (East Asian Width) の判定 - 中途](http://d.hatena.ne.jp/takenspc/20111126#1322252878).

## Install

    $ npm install eastasianwidth

## Usage

    var eaw = require('eastasianwidth');
    console.log(eaw.eastAsianWidth('￦')) // 'F'
    console.log(eaw.eastAsianWidth('｡')) // 'H'
    console.log(eaw.eastAsianWidth('뀀')) // 'W'
    console.log(eaw.eastAsianWidth('a')) // 'Na'
    console.log(eaw.eastAsianWidth('①')) // 'A'
    console.log(eaw.eastAsianWidth('ف')) // 'N'

    console.log(eaw.characterLength('￦')) // 2
    console.log(eaw.characterLength('｡')) // 1
    console.log(eaw.characterLength('뀀')) // 2
    console.log(eaw.characterLength('a')) // 1
    console.log(eaw.characterLength('①')) // 2
    console.log(eaw.characterLength('ف')) // 1

    console.log(eaw.length('あいうえお')) // 10
    console.log(eaw.length('abcdefg')) // 7
    console.log(eaw.length('￠￦｡ￜㄅ뀀¢⟭a⊙①بف')) // 19

---
_Source: https://npm.io/package/eastasianwidth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
