1.0.0 • Published 6 years ago

node-str-util v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

node-str-width2

Coverts characters width

npm i str-util

fork from ascii-fullwidth-halfwidth-convert string-width

Usage

import * as StrUtil from 'str-util';

FullHalf

const str = 'THE quick, BROWN\u3000fox.';

StrUtil.toFullWidth(str);
//=> 'THE quick, BROWN fox.'

StrUtil.toHalfWidth(str);
//=> 'THE quick, BROWN fox.'

console.log(StrUtil.toFullEnglish('123abcABCABC123/*-+=-0][’;/.+-*/=-09][\'";/.'));
console.log(StrUtil.toHalfEnglish('123abcABCABC123/*-+=-0][’;/.+-*/=-09][\'";/.'));
console.log(StrUtil.toFullNumber('123abcABCABC123/*-+=-0][’;/.+-*/=-09][\'";/.'));
console.log(StrUtil.toHalfNumber('123abcABCABC123/*-+=-0][’;/.+-*/=-09][\'";/.'));

default

0123456789
0123456789
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
 

!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~