decompress-tarbz2
Advanced tools
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 })); |
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
2843
3
45
+ Addedis-bzip2@^1.0.0
+ Addedstrip-dirs@^0.1.1
+ Addedansi-regex@0.2.1(transitive)
+ Addedansi-styles@1.1.0(transitive)
+ Addedchalk@0.5.1(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedget-stdin@3.0.2(transitive)
+ Addedhas-ansi@0.1.0(transitive)
+ Addedis-absolute@0.1.7(transitive)
+ Addedis-bzip2@1.0.0(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-integer@1.0.7(transitive)
+ Addedis-relative@0.1.3(transitive)
+ Addedstrip-ansi@0.3.0(transitive)
+ Addedstrip-dirs@0.1.1(transitive)
+ Addedsupports-color@0.2.0(transitive)
- Removedarchive-type@^0.1.4
- Removedrimraf@^2.2.8
- Removedarchive-type@0.1.4(transitive)
- Removedget-stdin@1.0.0(transitive)
- Removedis-7zip@0.1.0(transitive)
- Removedis-bzip2@0.1.0(transitive)
- Removedis-gzip@0.1.0(transitive)
- Removedis-rar@0.1.0(transitive)
- Removedis-tar@0.1.1(transitive)
- Removedis-zip@0.1.0(transitive)
- Removedread-chunk@0.1.0(transitive)