libzim
Version:
Bindings to zimlib (read/write OpenZIM files)
42 lines (23 loc) • 928 B
Markdown
string - the number of columns required to display it
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width.
Useful to be able to measure the actual width of command-line output.
```
$ npm install --save string-width
```
```js
var stringWidth = require('string-width');
stringWidth('古');
//=> 2
stringWidth('\u001b[1m古\u001b[22m');
//=> 2
stringWidth('a');
//=> 1
```
- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
MIT © [Sindre Sorhus](http://sindresorhus.com)
> Get the visual width of a