How wide is the node.js console? How wide is the node.js console? node.js node.js

How wide is the node.js console?


Looks like the current best way is this property:

process.stdout.columns

And for height (rows):

process.stdout.rows

Also note that there is a "resize" event, which might come in handy:

process.stdout.on('resize', function() {  console.log('screen size has changed!');  console.log(process.stdout.columns + 'x' + process.stdout.rows);});

Documentation here:http://nodejs.org/api/tty.html#tty_tty


if (process.stdout.isTTY) {  console.log("The console size is:", process.stdout.getWindowSize());} else {  console.log("stdout is not a console");}