Skip to content

Instantly share code, notes, and snippets.

@johnciacia
Created July 31, 2013 03:42
Show Gist options
  • Save johnciacia/6119106 to your computer and use it in GitHub Desktop.
Save johnciacia/6119106 to your computer and use it in GitHub Desktop.
Download and extract a tarball and gunzipped file with node
var request = require('request'),
zlib = require('zlib'),
tar = require('tar');
request('http://wordpress.org/latest.tar.gz')
.pipe(zlib.Unzip())
.pipe(tar.Extract({ path: __dirname }))
.on('error', function (er) {
console.error("error here" + er)
})
.on('end', function () {
console.error("done")
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment