decompress-tarbz2
Advanced tools
Comparing version 2.0.0 to 2.0.1
53
index.js
@@ -6,5 +6,4 @@ 'use strict'; | ||
var isBzip2 = require('is-bzip2'); | ||
var sbuff = require('simple-bufferstream'); | ||
var stripDirs = require('strip-dirs'); | ||
var tar = require('tar'); | ||
var tar = require('tar-stream'); | ||
var through = require('through2'); | ||
@@ -25,2 +24,3 @@ | ||
var self = this; | ||
var extract = tar.extract(); | ||
@@ -42,33 +42,34 @@ if (file.isNull()) { | ||
file.contents = bz2.decode(file.contents); | ||
extract.on('error', function (err) { | ||
cb(err); | ||
return; | ||
}); | ||
sbuff(file.contents).pipe(tar.Parse()) | ||
.on('error', function (err) { | ||
cb(err); | ||
return; | ||
}) | ||
extract.on('entry', function (header, stream, done) { | ||
var chunk = []; | ||
var len = 0; | ||
.on('entry', function (file) { | ||
if (file.type !== 'Directory') { | ||
var chunk = []; | ||
var len = 0; | ||
stream.on('data', function (data) { | ||
chunk.push(data); | ||
len += data.length; | ||
}); | ||
file.on('data', function (data) { | ||
chunk.push(data); | ||
len += data.length; | ||
}); | ||
file.on('end', function () { | ||
self.push(new File({ | ||
contents: Buffer.concat(chunk, len), | ||
path: stripDirs(file.path, opts.strip) | ||
})); | ||
}); | ||
stream.on('end', function () { | ||
if (header.type !== 'directory') { | ||
self.push(new File({ | ||
contents: Buffer.concat(chunk, len), | ||
path: stripDirs(header.name, opts.strip) | ||
})); | ||
} | ||
}) | ||
.on('end', function () { | ||
cb(); | ||
done(); | ||
}); | ||
}); | ||
extract.on('finish', function () { | ||
cb(); | ||
}); | ||
extract.end(bz2.decode(file.contents)); | ||
}); | ||
}; |
{ | ||
"name": "decompress-tarbz2", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "decompress tar.bz2 plugin", | ||
@@ -33,5 +33,4 @@ "license": "MIT", | ||
"seek-bzip": "^1.0.3", | ||
"simple-bufferstream": "0.0.4", | ||
"strip-dirs": "^0.1.1", | ||
"tar": "^1.0.0", | ||
"tar-stream": "^0.4.5", | ||
"through2": "^0.6.1", | ||
@@ -38,0 +37,0 @@ "vinyl": "^0.4.3" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
3534
+ Addedtar-stream@^0.4.5
+ Addedbl@0.9.5(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedtar-stream@0.4.7(transitive)
- Removedsimple-bufferstream@0.0.4
- Removedtar@^1.0.0
- Removedbalanced-match@1.0.2(transitive)
- Removedblock-stream@0.0.9(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfstream@1.0.12(transitive)
- Removedglob@7.2.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedinflight@1.0.6(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsimple-bufferstream@0.0.4(transitive)
- Removedtar@1.0.3(transitive)