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 1.0.0 to 1.0.1

25

index.js
'use strict';
var archiveType = require('archive-type');
var bz2 = require('seek-bzip');
var isBzip2 = require('is-bzip2');
var sbuff = require('simple-bufferstream');
var path = require('path');
var stripDirs = require('strip-dirs');
var tar = require('tar');

@@ -23,4 +23,5 @@

if (archiveType(file.contents) !== 'bz2') {
return cb();
if (!isBzip2(file.contents)) {
cb();
return;
}

@@ -35,2 +36,3 @@

})
.on('entry', function (file) {

@@ -46,18 +48,7 @@ if (file.type !== 'Directory') {

chunk = new Buffer(chunk, 'utf8');
if (opts.strip) {
var f = path.basename(file.path);
var p = path.dirname(file.path.split('/'));
if (Array.isArray(p)) {
p = p.slice(opts.strip).join(path.sep);
}
file.path = path.join(p, f);
}
files.push({ contents: chunk, path: file.path });
files.push({ contents: chunk, path: stripDirs(file.path, opts.strip) });
});
}
})
.on('end', function () {

@@ -64,0 +55,0 @@ decompress.files = files;

{
"name": "decompress-tarbz2",
"version": "1.0.0",
"version": "1.0.1",
"description": "decompress tar.bz2 plugin",

@@ -16,3 +16,3 @@ "license": "MIT",

"scripts": {
"test": "mocha --reporter list"
"test": "node test/test.js"
},

@@ -32,12 +32,13 @@ "files": [

"dependencies": {
"archive-type": "^0.1.4",
"rimraf": "^2.2.8",
"is-bzip2": "^1.0.0",
"seek-bzip": "^1.0.3",
"simple-bufferstream": "0.0.4",
"strip-dirs": "^0.1.1",
"tar": "^1.0.0"
},
"devDependencies": {
"ava": "0.0.4",
"decompress": "^1.0.0",
"mocha": "^1.18.2"
"rimraf": "^2.2.8"
}
}

@@ -15,6 +15,6 @@ # decompress-tarbz2 [![Build Status](https://travis-ci.org/kevva/decompress-tarbz2.svg?branch=master)](https://travis-ci.org/kevva/decompress-tarbz2)

var Decompress = require('decompress');
var zip = require('decompress-tarbz2');
var tarbz2 = require('decompress-tarbz2');
var decompress = new Decompress()
.src('foo.tarbz2')
.src('foo.tar.bz2')
.dest('destFolder')

@@ -21,0 +21,0 @@ .use(tarbz2({ strip: 1 }));

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