title: node.js does not flush buffers on a crash
body: <p>I am running node as a windows service. The service was crashing on startup so I implemented a logging system, to discover that messages do not get written to a file when the application is forced to exit. I have been able to duplicate the problem with the code below:</p>
  
  <pre><code>var fs = require('fs');
  
  var logStream = fs.createWriteStream('./nx3.log');
  logStream.end('Goodbye world');
  process.exit(0);
  </code></pre>
  
  <p>Nothing is written into nx3.log because the buffers don't flush. I have been able to work around the problem by using fs.appendFileSync but I would prefer to be using a mature logging module rather than rolling my own.</p>
  
  <p>Is it possible to open up a write stream that is unbuffered? Or some other way around this?</p>