visualwidth

unicode character visual width

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
visualwidth
1830.1.09 years ago12 years agoMinified + gzip package size for visualwidth in KB

Readme

VisualWidth
This is a unicode character's visual width calculator for javascript.
This module supports node.js, too.

SYNOPSIS

var vw = require('./visualwidth');
console.log(vw('あいうabc')); # => 9
console.log(vw.width('あいうabc')); # => 9
console.log(vw.truncate('ほう。hasegawaさん', 7, '...'));  => "ほう..."