npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

term-size

0.1.1 • Public • Published

term-size Build Status: Linux & macOS Build Status: Windows

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.

Confirmed working on macOS, Linux, and Windows.

Install

$ npm install --save term-size

Usage

const termSize = require('term-size');
 
termSize();
//=> {columns: 143, rows: 24}

API

termSize()

Returns an Object with columns and rows properties.

Related

License

MIT © Sindre Sorhus

install

npm i term-size

Downloadsweekly downloads

4,168,800

version

0.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability