bzip2.js
bzip2.js copied to clipboard
Use with pipes?
Hi
Is it possible to use bzip2.js in a pipe like the following with createGunzip:
var zlib = require('zlib')
, tar = require('tar')
, request = require('request');
request.get("http://localhost/file.tar.gz")
.pipe(zlib.createGunzip())
.pipe(tar.Extract({path: "./test"}))
.on("error", function(err){
console.log("Error on extract", err);
})
.on("end", function(){
console.log("done.");
});
?
i mean zlib.createGunzip() should be replace with bzip2.createBz2() or something like that.
You should be able to make this work with the node fibers package.