{"name":"cli-width","version":"4.1.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"},"types":"./index.d.ts","gitHead":"a813d2498abe52e3730bfe24cb7d934b04013633","_id":"cli-width@4.1.0","_nodeVersion":"12.22.11","_npmVersion":"8.5.5","dist":{"integrity":"sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==","shasum":"42daac41d3c254ef38ad8ac037672130173691c5","tarball":"http://registry-npm.ywwl.com/cli-width/download/cli-width-4.1.0.tgz","fileCount":5,"unpackedSize":4767,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAUh8z/Aqt9WDtuT/hYWY/nW5iJjUa54EZtgdR+KAVE0AiEAp5+HnrDNP3oaL8l9KfRaXHbUE5ziM9y3eXWkjIMhQ3U="}],"size":2244,"noattachment":false,"key":"/cli-width/-/cli-width-4.1.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.1.0_1691252041110_0.8962663373059998"},"_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":1691252041241,"_cnpm_publish_time":1691252041241,"dist-tags":{"latest":"4.1.0"}}