title: Write NodeJS stream into a string synchronously
body: <p>I know that one can synchronously read a file in NodeJS like this:</p>
  
  <pre><code>var fs = require('fs');
  var content = fs.readFileSync('myfilename');
  console.log(content);
  </code></pre>
  
  <p>I am instead interested in being able to read the contents from a stream into a string synchronously. Thoughts?</p>