mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-14 15:16:18 +00:00
.. | ||
index.js | ||
package.json | ||
README.md |
Calculates width of given string. Treat ambiguous-width characters as fullwidth (= 2
) by default.
USAGE
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
INSTALL
$ npm install --save-dev power-assert-util-string-width
AUTHOR
LICENSE
Licensed under the MIT license.