{"_id":"terminal-size","_rev":"4312387","name":"terminal-size","description":"Reliably get the terminal window size (columns & rows)","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-07T21:55:57.000Z","created":"2023-11-04T17:48:22.924Z","4.0.1":"2026-02-02T05:23:26.211Z","4.0.0":"2023-11-04T17:48:22.924Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/terminal-size.git"},"versions":{"4.0.1":{"name":"terminal-size","version":"4.0.1","description":"Reliably get the terminal window size (columns & rows)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/terminal-size.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["terminal","size","console","window","width","height","columns","rows","lines","tty","redirected"],"devDependencies":{"ava":"^5.3.1","execa":"^8.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"gitHead":"0cbd793b9a0d3f81d85970fb3d3815c25c029435","types":"./index.d.ts","_id":"terminal-size@4.0.1","bugs":{"url":"https://github.com/sindresorhus/terminal-size/issues"},"homepage":"https://github.com/sindresorhus/terminal-size#readme","_nodeVersion":"25.3.0","_npmVersion":"11.7.0","dist":{"shasum":"4fe8cb7482aae253f042bcd0c67b61f2dde97901","size":2924,"noattachment":false,"key":"/terminal-size/-/terminal-size-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/terminal-size/download/terminal-size-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/terminal-size_4.0.1_1770009806064_0.38460371924160697"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-02T05:23:26.211Z","publish_time":1770009806211,"_source_registry_name":"default","_cnpm_publish_time":1770009806211},"4.0.0":{"name":"terminal-size","version":"4.0.0","description":"Reliably get the terminal window size (columns & rows)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/terminal-size.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["terminal","size","console","window","width","height","columns","rows","lines","tty","redirected"],"devDependencies":{"ava":"^5.3.1","execa":"^8.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"e2393bccff7175e3740492b253ca967601aab22d","bugs":{"url":"https://github.com/sindresorhus/terminal-size/issues"},"homepage":"https://github.com/sindresorhus/terminal-size#readme","_id":"terminal-size@4.0.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"a0b7530518afe5f49952c58251ec6e2e3a740570","size":2671,"noattachment":false,"key":"/terminal-size/-/terminal-size-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/terminal-size/download/terminal-size-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/terminal-size_4.0.0_1699120102709_0.38355700776842205"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-04T17:48:22.924Z","publish_time":1699120102924,"_source_registry_name":"default","_cnpm_publish_time":1699120102924}},"readme":"# terminal-size\n\n> Reliably get the terminal window size\n\nBecause [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) doesn't exist when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped. This module even works when all the TTY file descriptors are redirected!\n\nConfirmed working on macOS, Linux, and Windows.\n\n## Install\n\n```sh\nnpm install terminal-size\n```\n\n## Usage\n\n```js\nimport terminalSize from 'terminal-size';\n\nterminalSize();\n//=> {columns: 143, rows: 24}\n```\n\n## API\n\n### terminalSize()\n\nReturns an `object` with `columns` and `rows` properties.\n\n## Related\n\n- [terminal-size-cli](https://github.com/sindresorhus/terminal-size-cli) - CLI for this module\n","_attachments":{},"homepage":"https://github.com/sindresorhus/terminal-size#readme","bugs":{"url":"https://github.com/sindresorhus/terminal-size/issues"},"license":"MIT"}