Socket
Socket
Sign inDemoInstall

decompress-tarbz2

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decompress-tarbz2 - npm Package Compare versions

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"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc