title: Node.js : Specify files to unzip with zlib + tar
body: <p>An installation process is downloading a <code>.tar.gz</code> archive, then extract the files to a destination directory. However, not all the files in the archive are required, and I'd like to specify which files should be extracted. The naïve way would be to delete the unnecessary files after extraction, but I'd like a "cleaner" way and filter out instead.</p>
  
  <p>Is this possible?</p>
  
  <p>The (relevant) code I have so far is (stripped for readability)</p>
  
  <pre><code>var fs = require('fs');
  var tar = require('tar');
  var zlib = require('zlib');
  
  var log = console.log;
  
  var tarball = 'path/to/downloaded/archive.tar.gz';
  var dest = 'path/to/destination';
  
  fs.createReadStream(tarball)
    .on("error", log)
    .pipe(zlib.Unzip())
    .pipe(tar.Extract({ path: dest }))
    .on("end", log);
  </code></pre>
  
  <p>Thank you.</p>