console.log(process.env.COLUMNS)
Yields undefined, although,
$ echo $COLUMNS
Outputs as expected:
78
I have been trying running Node like this env node myprog.js, still undefined. What's wrong with me or any other way to know the width of terminal? (For nice formatting of some output data).
console.log(process.env)outputs the same asprintenvand for some reason $COLUMNS is not onprintenvoutput.