term-size

4.0.0last stable release 1 year ago
Complexity Score
Low
Open Issues
7
Dependent Projects
193
Weekly Downloadsglobal
4,409,142

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

terminal-size

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.

Install

npm install terminal-size

Usage

import terminalSize from 'terminal-size';

terminalSize();
//=> {columns: 143, rows: 24}

API

terminalSize()

Returns an object with columns and rows properties.

Related

  • terminal-size-cli - CLI for this module

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
4.30
Test Coverage
No Data
Follows Semver
Yes
Github Stars
140
Dependenciestotal
4
DependenciesOutdated
4
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute term-size in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install term-size
Processing...
Done

14 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.