Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cli-sizes

ahadb4MIT1.0.0

A node package to find the terminal size with one dead simple fallback option

terminal-size, size, terminal, getWindowSize, node, iTerm, cli, sizes, window, resize

readme

CLI SIZES

A node package to find the terminal size with a simple fallback option. Find the size of your terminal quickly

Installation

npm install --save cli-sizes

Usage

There is an options paramater that can be configured where possible - only one option for the time being can be passed

Examples

const size = require('cli-sizes')

console.log(size.cliSizes())
const size = require('cli-sizes')

// options
console.log(size.cliSizes({
getWindowSize: true
}))
// resize event
const size = require('cli-sizes')

console.log(size.resize())

API

  • cliSizes < function > Returns cols and rows with terminal size values
  • getWindowSize < object > Option used as a fallback: process.stdout
  • resize < function > Resize the terminal but retain dynamic values of size