This commit is contained in:
wushenghua
2017-05-10 17:19:39 +08:00
parent afafd9c07b
commit 6a48d33db7
907 changed files with 118717 additions and 35470 deletions
+19
View File
@@ -0,0 +1,19 @@
var tar = require("../tar.js")
, fs = require("fs")
function onError(err) {
console.error('An error occurred:', err)
}
function onEnd() {
console.log('Extracted!')
}
var extractor = tar.Extract({path: __dirname + "/extract"})
.on('error', onError)
.on('end', onEnd);
fs.createReadStream(__dirname + "/../test/fixtures/c.tar")
.on('error', onError)
.pipe(extractor);