mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 19:31:09 +00:00

PR-URL: https://github.com/nodejs/io.js/pull/2286 Reviewed-By: Roman Reiss <me@silverwind.io>
31 lines
477 B
Markdown
31 lines
477 B
Markdown
cli-width
|
|
=========
|
|
|
|
Get stdout window width, with three fallbacks, `tty`, a custom environment variable and then a default.
|
|
|
|
## Usage
|
|
|
|
```
|
|
npm install --save cli-width
|
|
```
|
|
|
|
```js
|
|
'use stict';
|
|
|
|
var cliWidth = require('cli-width');
|
|
|
|
cliWidth(); // maybe 204 :)
|
|
```
|
|
|
|
You can also set the `CLI_WIDTH` environment variable.
|
|
|
|
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
|
|
```
|