title: Does Express.js support sending unbuffered progressively flushed responses?
body: <p>Perl's Catalyst framework permitts you to send an progressively flushed response over an open connection. You could for instance use <a href="https://metacpan.org/module/Catalyst%3a%3aResponse#res-write_fh"><code>write_fh()</code> on Catalyst::Response</a>. I've begun using Node.js, and I can't find how to do the equivalent.</p>
  
  <p>If I want to send a big CSV file, on the order of 200 megs is there a way to do that without buffering the whole CSV file in memory? Granted, the client will timeout if you don't send data in a certain amount of time, so a promise would be nice if -- but is there anyway to do this?</p>
  
  <p>When I try to do a <code>res.send(text)</code> in a callback, I get</p>
  
  <pre><code>Express
  500 Error: This socket has been ended by the other party
  </code></pre>
  
  <p>And, it doesn't seem that Express.js supports an explicit <code>socket.close()</code> or anything of the ilk.</p>
  
  <p>Here is an example,</p>
  
  <pre><code>exports.foo = function (res) {                          
    var query = client.query("SELECT * FROM naics.codes");
    query.on('row', function(row) {                       
      //console.log(row);                                 
      res.write("GOT A ROW");                             
    });                                                   
    query.on('end', function() {                          
      res.end();                                          
      client.end();                                       
    });                                                   
  };                                                      
  </code></pre>
  
  <p>I would expect for that to send "GOT A ROW" out for each row, until the call to <code>client.end()</code> signifying completion.</p>