{"name":"cli-width","version":"2.2.1","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","devDependencies":{"coveralls":"^3.0.11","nyc":"^15.0.1","standard-version":"^7.1.0","tap-spec":"^5.0.0","tape":"^4.13.2"},"gitHead":"271bf678a0925cc5f400404cfc78ffb71e7057e6","_id":"cli-width@2.2.1","_nodeVersion":"12.16.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==","shasum":"b0433d0b4e9c847ef18868a4ef16fd5fc8271c48","tarball":"http://registry-npm.ywwl.com/cli-width/download/cli-width-2.2.1.tgz","fileCount":9,"unpackedSize":11189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeldKSCRA9TVsSAnZWagAANy0P/1STRKiOyZfQQIJwDYCD\nKmuLqSMMns4rmcGCs0xlxrX9WwVm+h+Wk6Hc4dC0O1GKz85QgtZiZg+WTafc\nFeOZvm6oGAKo5hCGmZ/YNBKZyPMRGdzzjxa1smfDaKbj2Uppj1lKLiG9dLx+\nllzFaURmq7tA1fLJt0ze2T48Vb6ea3SjBUIpAKcsu+kWzs5qYSzFJRcA7sLj\nO+7K5nHxs5mcpTR+g3i5MQOojntvJ2ehdmRcmdQoOm9TwW+6GqPDawTk2Hf8\nHC+GkPN4vtW4aVOmxdCLrdP5fyltpoFTPyCNnQNz1ed9GMm9tQJ8Asu6pWTS\nGRmTXhu+xA2f8IrFzKSJQtwExNZVQm6YqBr2oEFP+BJUxJ9osNd8s8cz1qri\ns+KckAZRJLFum9uJNpswyOhqU2pIBSwyD3BTVCiSFcRTwQ6E/yE0kPc3vwhO\n+oBeEqs7BEGtQztlqrOeT5i5X2cQfT4YkUb15b973NXl2XU9qEuI3xq1kujS\nMkjxn4i6xBswryJDrwcLyLHWahPIpW8xmWG1GGnWg8AwU3h7ByGXMidgVmYB\nZnf/qRzXMt1RLqOfg1WcuJvrWlsoirDGbUIVCe6Aso/4XNzk1mfD0SiwO9/H\nXD7VBQxwBvJGOJxbqK+iKkECap63rBDD0dZaGu/xMjqJtBsZNysk8n/goZs7\nEqni\r\n=nJn+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwjuql7aml4vk3zBHzQvRba85/bGF4X2e62D+7tS4BdAIhAM1S5RzvVwQVtAeligO4d35PEO66iahKLGl2CSoaFIbn"}],"size":3907,"noattachment":false,"key":"/cli-width/-/cli-width-2.2.1.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_2.2.1_1586877074212_0.7202057873507315"},"_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":1586877074372,"_cnpm_publish_time":1586877074372,"dist-tags":{"latest":"4.1.0"}}