node-str-util
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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
 

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

Readme

Keywords

none

Package Sidebar

Install

npm i node-str-util

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • bluelovers