{"name":"cli-width","version":"3.0.0","description":"Get stdout window width, with two fallbacks, tty and then a default.","main":"index.js","scripts":{"test":"node test | tspec","coverage":"nyc node test | tspec","coveralls":"npm run coverage -s && coveralls < coverage/lcov.info","release":"standard-version"},"repository":{"type":"git","url":"git+ssh://git@github.com/knownasilya/cli-width.git"},"author":{"name":"Ilya Radchenko","email":"knownasilya@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/knownasilya/cli-width/issues"},"homepage":"https://github.com/knownasilya/cli-width","engines":{"node":">= 10"},"devDependencies":{"coveralls":"^3.0.11","nyc":"^15.0.1","standard-version":"^7.1.0","tap-spec":"^5.0.0","tape":"^4.13.2"},"gitHead":"c96cf6e8b9a02256ded31e412490e29dbad30603","_id":"cli-width@3.0.0","_nodeVersion":"12.16.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==","shasum":"a2f48437a2caa9a22436e794bf071ec9e61cedf6","tarball":"http://registry-npm.ywwl.com/cli-width/download/cli-width-3.0.0.tgz","fileCount":9,"unpackedSize":11494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeldVmCRA9TVsSAnZWagAAvmsP/RZeOb9v056ITvwOmYQt\npdnoizv359Aho6K4fpJ5Ooxpeca+baQ8/1Ik8SDscuji2LyYm12LQR3Dvjac\n+tkleotn3CNzI1iyAkubPaBtntvCEzKPZD7xY8pJiOr6J7OKLa5WL4fAXFF3\nIzSgjfaO1wOyEFWDp3dlkBPtGiJVBLPrkOlEOz+sFiZhKqC+8KGHdLcvdA+P\nQPiSGtl3ewRerqBq1otz33iTraj7LEy/1pOTTs0+ccsJTctcFwPFIeXM6hnp\nSbZCzsNsSBdbcvjuBbmRFVOu12ajzLiEWw/lOTC1S9d0jI7A65Jw3t46A8vn\nBy2abgmhxcQ6HlaEY7Jrw9tKucbllRFXxSBaF+0LTdPbOWeKJoCzfm8zD/DT\nw3yRrZ815IwjQgwhUAIVI8oh/QPIrYS6+WHFNk2Cq4SGItaKSmOgy1DFl9Ja\n24g57GYnprXEOS1r5GPFOPRcRsSB9U2UJkfjIQ63n7bVbDx3mvje8o4XoAKr\ng+SMzY05ZUZC0h27YVbiAmSHsnH6AOumiVGR7r1QmpRun1etPrpnskzsUbyO\nyYPzOBED0lxzGL1NqvBQImXxsaK1MCKgdwVHIixDOoxiFtSwTHE9O39Qcvjk\nvPk7LX0GRhRLi1UzwfbUoPbmenKr8ZAD10I5s0bm8lIeDqMN8fzR0g8wOGE2\nFiOg\r\n=mluF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzQop3hr8nda9/Z/rKtiwMxB56Aq1J73dcwgJZcBqChAiBIxkgWqhMVdwnVPSbJPBYnhUXJfXeMv9icVHgN3RSUrA=="}],"size":4026,"noattachment":false,"key":"/cli-width/-/cli-width-3.0.0.tgz"},"maintainers":[{"name":"knownasilya","email":"ilya@burstcreations.com"},{"name":"sboudrias","email":"admin@simonboudrias.com"}],"_npmUser":{"name":"knownasilya","email":"knownasilya@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-width_3.0.0_1586877798281_0.1335442509204645"},"_hasShrinkwrap":false,"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":1586877798434,"_cnpm_publish_time":1586877798434,"dist-tags":{"latest":"4.1.0"}}