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

node-targz

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-targz - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

test/example/example-compress/test.txt

36

lib/index.js

@@ -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({

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