mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
477 B
31 lines
477 B
10 years ago
|
cli-width
|
||
|
=========
|
||
|
|
||
9 years ago
|
Get stdout window width, with three fallbacks, `tty`, a custom environment variable and then a default.
|
||
10 years ago
|
|
||
|
## Usage
|
||
|
|
||
|
```
|
||
|
npm install --save cli-width
|
||
|
```
|
||
|
|
||
|
```js
|
||
|
'use stict';
|
||
|
|
||
|
var cliWidth = require('cli-width');
|
||
|
|
||
|
cliWidth(); // maybe 204 :)
|
||
|
```
|
||
|
|
||
9 years ago
|
You can also set the `CLI_WIDTH` environment variable.
|
||
|
|
||
10 years ago
|
If none of the methods are supported, the default is `0` and
|
||
|
can be changed via `cliWidth.defaultWidth = 200;`.
|
||
|
|
||
|
## Tests
|
||
|
|
||
|
```bash
|
||
|
npm install
|
||
|
npm test
|
||
|
```
|