{"name":"cli-width","version":"4.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":">= 12"},"devDependencies":{"coveralls":"^3.1.1","nyc":"^15.1.0","standard-version":"^9.3.2","tap-spec":"^5.0.0","tape":"^5.5.2"},"volta":{"node":"12.22.11","npm":"8.5.5"},"gitHead":"dd703b65969d4f8f2be3d78f292e64aebb4385e9","_id":"cli-width@4.0.0","_nodeVersion":"12.22.11","_npmVersion":"8.5.5","dist":{"integrity":"sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==","shasum":"a5622f6a3b0a9e3e711a25f099bf2399f608caf6","tarball":"http://registry-npm.ywwl.com/cli-width/download/cli-width-4.0.0.tgz","fileCount":7,"unpackedSize":5378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQwuFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZ/RAAjOrovQTn2bkM+nWByWHS78XXuTWZhuaWCZFhnkDBgYvkG5fi\r\nJDhhj9nbVwqMDvPDtO2tUkFDCKiUxpYCZl2T4eW4W60PHMHPZioq3Nz+SJz+\r\nZsKy1M42Vy1JkQoxkCNQmX28itEIi9uDSedbiqNshnm9/af1vUkhTkgEwuUf\r\nb/3JW47oZf6snZ0L6ZXSGVjXG1nLvleIpqLVOs85nBoQs4cy3uWWhNDOwFUT\r\ngzplI5TT98vXLpIv1zL+6ktJyu8st0G+j2I6gwKRtw1dOx60893PdEM6bPtJ\r\nZ3HWRckNK3EvOOpfffQLozd0uvfhz28aUnVxZGrpSIxJdTAFdkvV1lBQ2xVl\r\nL903y/gWqn25BCI5OMTUgatId0I3L1nS/84jwN2HznQBYEfKACvdBg9BSqDa\r\nacaBhV6TlwkJDotYg5r0EzcKGSNRR3G0l91DgeDlF3VFCt3snoUT0tuF2Eb0\r\nPKG0XIYkhw+vecEscPNdynu+VxttIsCWdCVEa0ZiqlRX2hk0JymERjgFAKTU\r\nuY6UV70ENpobyjPWj+W71+OBXcQ00f6YQquEFDi18jCySwdGQbLwvj5f4Iuf\r\nS2QazBesKtIZ+bNujxtpCmsbwx1NTWNjmEkNDNqq+C32XwohlggBlzW8pmFW\r\nXHGSHDOK/easSbYg95b6CDY1InHIWAcawK0=\r\n=JMdL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErq7tCWDjvxLIqcF63WtNSobBm9uKoV+vlmrS/PxWc4AiEA1nB0E/iwj8uF+FN8TXwgoXgRM3ZRLQnEsXoMSw9DHXs="}],"size":2613,"noattachment":false,"key":"/cli-width/-/cli-width-4.0.0.tgz"},"_npmUser":{"name":"knownasilya","email":"knownasilya@gmail.com"},"directories":{},"maintainers":[{"name":"knownasilya","email":"knownasilya@gmail.com"},{"name":"sboudrias","email":"admin@simonboudrias.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-width_4.0.0_1648561029720_0.4160089847445092"},"_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":1648561029944,"_cnpm_publish_time":1648561029944,"dist-tags":{"latest":"4.1.0"}}