Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including ascii-fullwidth-halfwidth-convert with all npm packages installed. Try it out:

var asciiFullwidthHalfwidthConvert = require("ascii-fullwidth-halfwidth-convert")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ascii-fullwidth-halfwidth-convert v0.1.1

Convert ASCII to their full-width form and back.

ascii-fullwidth-halfwidth-convert

Coverts ASCII characters in the range \u0021-\u007E to their equivalent full-width form (\uFF01-\uFF5E), and vice versa. Also converts between the ASCII space \u0020 and Ideographic Space \u3000.

Install

$ npm install ascii-fullwidth-halfwidth-convert

Usage

const AFHConvert = require('ascii-fullwidth-halfwidth-convert');
const converter = new AFHConvert();
const str = 'THE quick, BROWN\u3000fox.';

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

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

License

MIT © Sampath Sitinamaluwa

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free