You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Pau aff9d08cee client 1 year ago
vendor client 1 year ago
index.d.ts client 1 year ago
index.js client 1 year ago
license client 1 year ago
package.json client 1 year ago client 1 year ago

term-size Build Status

Reliably get the terminal window size

Because process.stdout.columns doesn't exist when run non-interactively, for example, in a child process or when piped. This module even works when all the TTY file descriptors are redirected!

Confirmed working on macOS, Linux, and Windows.


$ npm install term-size


const termSize = require('term-size');

//=> {columns: 143, rows: 24}



Returns an object with columns and rows properties.


The bundled macOS binary is signed and hardened.

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.