title: create on fly zip file for download through node.js
body: <p>I simply need to achieve below setup with node js script (generate the zip on the fly without ever touching disk and respond back to client to download). Can someone guide and post your working scripts. I tried googling, seems we can achieve it through zipstream. But didn't find any example/working script.</p>
  
  <ol>
  <li><p>grab the files matching *.xml files from root folder.</p></li>
  <li><p>Immediately writes to the client’s http response the http headers to say it’s a download and the file name is .zip.</p></li>
  <li><p>zipstream writes the header bytes of zip container.</p></li>
  <li><p>Creates an http request to the first image in S3.</p></li>
  <li><p>Pipes that into zipstream (we don’t actually need to run deflate as the images are already compressed).</p></li>
  <li><p>Pipes that into the client’s http response.</p></li>
  <li><p>Repeats for each image, with zipstream correctly writing envelopes for each file.</p></li>
  <li><p>zipstream writes the footer bytes for the zip container</p></li>
  <li><p>Ends the http response.</p></li>
  </ol>
  
  <p>Thanks,</p>
  
  <p>Srinivas</p>