Comparing version 0.0.3 to 0.1.0
@@ -5,10 +5,11 @@ var tar = require('tar-fs'), | ||
exports = module.exports = { | ||
compress: function (params, callback) { | ||
callback = callback || function () {}; | ||
var error = function (error) { | ||
throw error; | ||
module.exports = { | ||
compress: function(params, callback) { | ||
params.options = params.options || {}; | ||
callback = callback || function() {}; | ||
var error = function(error) { | ||
return callback(error); | ||
}; | ||
process.nextTick(function () { | ||
tar.pack(params.source) | ||
process.nextTick(function() { | ||
tar.pack(params.source, params.options) | ||
.on('error', error) | ||
@@ -22,11 +23,14 @@ .pipe(zlib.createGzip({ | ||
.on('error', error) | ||
.on('finish', callback)); | ||
.on('finish', function() { | ||
return callback(null); | ||
})); | ||
}); | ||
}, | ||
decompress: function (params, callback) { | ||
callback = callback || function () {}; | ||
var error = function (error) { | ||
throw error; | ||
decompress: function(params, callback) { | ||
params.options = params.options || {}; | ||
callback = callback || function() {}; | ||
var error = function(error) { | ||
return callback(error); | ||
}; | ||
process.nextTick(function () { | ||
process.nextTick(function() { | ||
fs.createReadStream(params.source) | ||
@@ -36,7 +40,9 @@ .on('error', error) | ||
.on('error', error)) | ||
.pipe(tar.extract(params.destination) | ||
.pipe(tar.extract(params.destination, params.options) | ||
.on('error', error) | ||
.on('finish', callback)); | ||
.on('finish', function() { | ||
return callback(null); | ||
})); | ||
}); | ||
} | ||
}; |
{ | ||
"name": "node-targz", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "Simple gzip compression and decompression library for Node.js", | ||
@@ -22,3 +22,3 @@ "keywords": [ | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "mocha -R spec && rm test/example-compress.tar.gz && rm -rf test/example-decompress", | ||
"prepublish": "npm prune" | ||
@@ -30,4 +30,7 @@ }, | ||
"dependencies": { | ||
"tar-fs": "^1.2.0" | ||
"tar-fs": "^1.13.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.5.3" | ||
} | ||
} | ||
} |
@@ -18,3 +18,6 @@ ### Simple gzip compression and decompression utility for Node.js | ||
level: 6, // optional | ||
memLevel: 6 // optional | ||
memLevel: 6, // optional | ||
options: { // options from https://github.com/mafintosh/tar-fs | ||
entries: ['test.txt'] | ||
} | ||
}, function () { | ||
@@ -21,0 +24,0 @@ tarGzip.decompress({ |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
5165
10
69
2
39
1
1
Updatedtar-fs@^1.13.0