title: Write the contents of node debug log to file
body: <p>I can I write the contents of this output to a file? I'm using the <a href="https://github.com/visionmedia/debug" rel="nofollow">debug</a> module to log messages, I'd like to be able to pipe them to a file. However its not working as expected.</p>
  
  <pre><code>$ DEBUG=* node -e 'var debug = require("debug")("test"); debug("hello world")'
      test hello world +0ms
  $ DEBUG=* node -e 'var debug = require("debug")("test"); debug("hello world")' &gt; temp.txt
      test hello world +0ms
  </code></pre>
  
  <p>Just tried this and received no output as well.</p>
  
  <pre><code>$ { DEBUG=* node -e "var debug = require('debug')('test'); debug('hello world')"; } &gt;temp.txt
      test hello world +0ms
  </code></pre>