{"name":"cli-width","version":"2.0.0","description":"Get stdout window width, with two fallbacks, tty and then a default.","main":"index.js","scripts":{"test":"node test | tspec","coverage":"isparta cover test/*.js | tspec","coveralls":"npm run coverage -s && coveralls < coverage/lcov.info","postcoveralls":"rimraf ./coverage"},"repository":{"type":"git","url":"git+ssh://git@github.com/knownasilya/cli-width.git"},"author":{"name":"Ilya Radchenko","email":"ilya@burstcreations.com"},"license":"ISC","bugs":{"url":"https://github.com/knownasilya/cli-width/issues"},"homepage":"https://github.com/knownasilya/cli-width","devDependencies":{"tap-spec":"^4.1.0","tape":"^3.4.0","coveralls":"^2.11.4","isparta":"^3.0.4","rimraf":"^2.4.3"},"gitHead":"a81748923ff3cdbb49853cf96de490992097cbb5","_id":"cli-width@2.0.0","_shasum":"067c42c5c92dc50f29d7cf4c5792c638c4d0b897","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"knownasilya","email":"ilya@burstcreations.com"},"maintainers":[{"name":"knownasilya","email":"ilya@burstcreations.com"}],"dist":{"shasum":"067c42c5c92dc50f29d7cf4c5792c638c4d0b897","tarball":"http://registry-npm.ywwl.com/cli-width/download/cli-width-2.0.0.tgz","integrity":"sha512-4lHOpM27t0lwFzg3W+enWLozpeDnGfVg6QRxqmWvlqIq2KtyiyYVSBscpNlxW/c9BDgCyOAsH1PEn/XOCflEAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFd7Jj7gerDWIsrrjIYjSegbPgLSVXPC33YpOmOwfAVrAiAkDqEthb/F4Bk9qLl7r/578ef+TWDrtUVMDpv8yRALog=="}],"size":15903,"noattachment":false,"key":"/cli-width/-/cli-width-2.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/cli-width-2.0.0.tgz_1454942077201_0.3669316528830677"},"directories":{},"readme":"# cli-width\n\nGet stdout window width, with four fallbacks, `tty`, `output.columns`, a custom environment variable and then a default.\n\n[![npm version](https://badge.fury.io/js/cli-width.svg)](http://badge.fury.io/js/cli-width)\n[![Build Status](https://travis-ci.org/knownasilya/cli-width.svg)](https://travis-ci.org/knownasilya/cli-width)\n[![Coverage Status](https://coveralls.io/repos/knownasilya/cli-width/badge.svg?branch=master&service=github)](https://coveralls.io/github/knownasilya/cli-width?branch=master)\n\nTested against Node v12 to v20.\nIncludes TypeScript types.\n\n## Usage\n\n```\nnpm install --save cli-width\n```\n\n```js\nconst cliWidth = require('cli-width');\n\ncliWidth(); // maybe 204 :)\n```\n\nYou can also set the `CLI_WIDTH` environment variable.\n\nIf none of the methods are supported, and the environment variable isn't set,\nthe default width value is going to be `0`, that can be changed using the configurable `options`.\n\n## API\n\n### cliWidth([options])\n\n`cliWidth` can be configured using an `options` parameter, the possible properties are:\n\n- **defaultWidth**\\<number\\> Defines a default value to be used if none of the methods are available, defaults to `0`\n- **output**\\<object\\> A stream to be used to read width values from, defaults to `process.stdout`\n- **tty**\\<object\\> TTY module to try to read width from as a fallback, defaults to `require('tty')`\n\n### Examples\n\nDefining both a default width value and a stream output to try to read from:\n\n```js\nconst cliWidth = require('cli-width');\nconst ttys = require('ttys');\n\ncliWidth({\n  defaultWidth: 80,\n  output: ttys.output,\n});\n```\n\nDefines a different tty module to read width from:\n\n```js\nconst cliWidth = require('cli-width');\nconst ttys = require('ttys');\n\ncliWidth({\n  tty: ttys,\n});\n```\n\n## Tests\n\n```bash\nnpm install\nnpm test\n```\n\nCoverage can be generated with `npm run coverage`.\n","publish_time":1454942080031,"_cnpm_publish_time":1454942080031,"dist-tags":{"latest":"4.1.0"}}