CoolFace
Apppublic

Umama-at-Bluchip/Quick-UI

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
README.md33 linesDownload Raw Back to eastasianwidth
1# East Asian Width2 3Get [East Asian Width](http://www.unicode.org/reports/tr11/) from a character.4 5'F'(Fullwidth), 'H'(Halfwidth), 'W'(Wide), 'Na'(Narrow), 'A'(Ambiguous) or 'N'(Natural).6 7Original Code is [東アジアの文字幅 (East Asian Width) の判定 - 中途](http://d.hatena.ne.jp/takenspc/20111126#1322252878).8 9## Install10 11    $ npm install eastasianwidth12 13## Usage14 15    var eaw = require('eastasianwidth');16    console.log(eaw.eastAsianWidth('₩')) // 'F'17    console.log(eaw.eastAsianWidth('。')) // 'H'18    console.log(eaw.eastAsianWidth('뀀')) // 'W'19    console.log(eaw.eastAsianWidth('a')) // 'Na'20    console.log(eaw.eastAsianWidth('①')) // 'A'21    console.log(eaw.eastAsianWidth('ف')) // 'N'22 23    console.log(eaw.characterLength('₩')) // 224    console.log(eaw.characterLength('。')) // 125    console.log(eaw.characterLength('뀀')) // 226    console.log(eaw.characterLength('a')) // 127    console.log(eaw.characterLength('①')) // 228    console.log(eaw.characterLength('ف')) // 129 30    console.log(eaw.length('あいうえお')) // 1031    console.log(eaw.length('abcdefg')) // 732    console.log(eaw.length('¢₩。ᅵㄅ뀀¢⟭a⊙①بف')) // 1933