console.log(process.env.COLUMNS)
Yields undefined, although,
undefined
$ echo $COLUMNS
Outputs as expected:
console.log('Terminal size: ' + process.stdout.columns + 'x' + process.stdout.rows);
And the output looks like e.g. "Terminal size: 80x24". There is also an event if the console size changes.
It's explained under tty in the docs.