Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/sindresorhus/string-width-cli

Get the visual width of a string - the number of columns required to display it
https://github.com/sindresorhus/string-width-cli

Last synced: about 2 months ago
JSON representation

Get the visual width of a string - the number of columns required to display it

Lists

README

        

# string-width-cli

> Get the visual width of a 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.

## Install

```sh
npm install --global string-width-cli
```

## Usage

```
string-width --help

Usage
$ string-width

Example
$ string-width a古
3
```

## Related

- [string-width](https://github.com/sindresorhus/string-width) - API for this module