|
1 rok pred | |
---|---|---|
.. | ||
README.md | 1 rok pred | |
index.js | 1 rok pred | |
package.json | 1 rok pred |
Calculates width of given string. Treat ambiguous-width characters as fullwidth (= 2
) by default.
var stringWidth = require('power-assert-util-string-width');
stringWidth('abcde'); //=> 5
stringWidth('あいうえお'); //=> 10
stringWidth('アイウエオ'); //=> 5
stringWidth('※脚注'); //=> 6
// stringWidth.narrow treats ambiguous-width characters as narrow (= `1`)
stringWidth.narrow('※脚注'); //=> 5
$ npm install --save-dev power-assert-util-string-width
Licensed under the MIT license.