title: how to convert multiple files to compressed zip file using node js
body: <p>I want to convert multiple files to a compressed zip file on node.js. </p>
  
  <p>I tried the following code:</p>
  
  <pre><code>var archiver = require('archiver');
  var fs = require('fs');
  var StringStream = require('string-stream');
  
  http.createServer(function(request, response) {
      var dl = archiver('data');
      dl.pipe(response);
      dl.append(new fs.createReadStream('test/fixtures/test.txt'), {
          name: 'stream.txt', date: testDate2
      });
      dl.append(new StringStream("Ooh dynamic stuff!"), {
          name : 'YoDog/dynamic.txt'
      });
      dl.finalize(function(err) {
          if (err)
              res.send(200000)
      });
  }).listen(3500);
  </code></pre>