Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 1.0.2 to 2.0.0

27

index.js
'use strict';
var bz2 = require('seek-bzip');
var File = require('vinyl');
var isBzip2 = require('is-bzip2');

@@ -8,2 +9,3 @@ var sbuff = require('simple-bufferstream');

var tar = require('tar');
var through = require('through2');

@@ -21,7 +23,17 @@ /**

return function (file, decompress, cb) {
var files = [];
return through.obj(function (file, enc, cb) {
var self = this;
if (file.isNull()) {
cb(null, file);
return;
}
if (file.isStream()) {
cb(new Error('Streaming is not supported'));
return;
}
if (!isBzip2(file.contents)) {
cb();
cb(null, file);
return;

@@ -49,4 +61,6 @@ }

file.on('end', function () {
chunk = Buffer.concat(chunk, len);
files.push({ contents: chunk, path: stripDirs(file.path, opts.strip) });
self.push(new File({
contents: Buffer.concat(chunk, len),
path: stripDirs(file.path, opts.strip)
}));
});

@@ -57,6 +71,5 @@ }

.on('end', function () {
decompress.files = files;
cb();
});
};
});
};
{
"name": "decompress-tarbz2",
"version": "1.0.2",
"version": "2.0.0",
"description": "decompress tar.bz2 plugin",

@@ -35,9 +35,11 @@ "license": "MIT",

"strip-dirs": "^0.1.1",
"tar": "^1.0.0"
"tar": "^1.0.0",
"through2": "^0.6.1",
"vinyl": "^0.4.3"
},
"devDependencies": {
"ava": "0.0.4",
"decompress": "^1.0.0",
"rimraf": "^2.2.8"
"is-jpg": "^1.0.0",
"vinyl-file": "^1.1.0"
}
}

@@ -1,2 +0,2 @@

# decompress-tarbz2 [![Build Status](https://travis-ci.org/kevva/decompress-tarbz2.svg?branch=master)](https://travis-ci.org/kevva/decompress-tarbz2)
# decompress-tarbz2 [![Build Status](http://img.shields.io/travis/kevva/decompress-tarbz2.svg?style=flat)](https://travis-ci.org/kevva/decompress-tarbz2)

@@ -19,8 +19,27 @@ > tar.bz2 decompress plugin

.src('foo.tar.bz2')
.dest('destFolder')
.dest('dest')
.use(tarbz2({ strip: 1 }));
decompress.decompress();
decompress.run(function (err, files) {
if (err) {
throw err;
}
console.log('Files extracted successfully!');
});
```
You can also use this plugin with [gulp](http://gulpjs.com):
```js
var gulp = require('gulp');
var tarbz2 = require('decompress-tarbz2');
gulp.task('default', function () {
return gulp.src('foo.tar.bz2')
.pipe(tarbz2({ strip: 1 }))
.pipe(gulp.dest('dest'));
});
```
## Options

@@ -27,0 +46,0 @@

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