title: Test whether the actual output is a terminal or not in node.js
body: <p>I'm writing a command line interface for one of my programs, and I would like to use the colorized output of <a href="https://github.com/indexzero/winston" rel="noreferrer">winston</a> if it's appropriate (the output is a terminal and it's not redirected to a file).</p>
  
  <p>In bash it can be done with the <code>-t</code> test as this <a href="https://stackoverflow.com/questions/911168/detect-if-shell-script-is-running-through-a-pipe#answer-911213">SO answer</a> correctly says. But I'm looking for the node.js alternative for testing this.</p>