New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-unzip

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-unzip - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

CONTRIBUTING.md

57

index.js

@@ -1,9 +0,7 @@

var through = require('through2');
var unzip = require('unzipper')
var fs = require('fs')
var defaults = require('defaults')
var fancyLog = require('fancy-log')
var Vinyl = require('vinyl')
const through = require('through2').obj,
unzip = require('unzipper'),
Vinyl = require('vinyl');
module.exports = function(options){
module.exports = (options = {}) => {
function transform(file, enc, callback){

@@ -15,37 +13,30 @@ if (file.isNull()) {

var opts = {};
options = options || {};
opts.filter = options.filter || function () { return true; };
const opts = {};
opts.filter = options.filter || (() => true);
opts.keepEmpty = options.keepEmpty || false;
// unzip file
var self = this
file.pipe(unzip.Parse())
.on('entry', function(entry){
var chunks = []
.on('entry', entry => {
const chunks = [];
if(!opts.filter(entry)){
entry.autodrain()
// skip entry
return
entry.autodrain();
return;
}
entry.pipe(through.obj(function(chunk, enc, cb){
// fancyLog("Find file: "+ entry.path)
chunks.push(chunk)
cb()
}, function(cb){
if(entry.type == 'File' && (chunks.length > 0 || opts.keepEmpty)){
self.push(new Vinyl({
entry.pipe(through((chunk, enc, cb) => {
chunks.push(chunk);
cb();
}, cb => {
if(entry.type === 'File' && (chunks.length > 0 || opts.keepEmpty)){
this.push(new Vinyl({
cwd : "./",
path : entry.path,
contents: Buffer.concat(chunks)
}))
}));
}
cb()
}))
}).on('close', function(){
callback()
})
cb();
}));
}).on('close', callback);
}
return through.obj(transform);
}
return through(transform);
};
{
"name": "gulp-unzip",
"version": "1.0.0",
"version": "1.0.1",
"description": "gulp plugin for unzip",

@@ -8,3 +8,3 @@ "main": "index.js",

"type": "git",
"url": "https://github.com/inuscript/gulp-unzip.git"
"url": "https://github.com/terrierscript/gulp-unzip.git"
},

@@ -20,17 +20,45 @@ "scripts": {

],
"author": "inuscript",
"author": {
"name": "terrierscript",
"url": "https://github.com/terrierscript"
},
"contributors": [
{
"name":"Joey Cozza",
"url": "https://github.com/joeycozza"
},{
"name":"Joe Pettersson",
"url": "https://github.com/Joe8Bit"
},{
"name":"Erik Vold",
"url": "https://github.com/erikvold"
},{
"name":"hami",
"url": "https://github.com/hami-jp"
},{
"name":"Selwyn",
"url": "https://github.com/Siilwyn"
},{
"name":"João Moreno",
"url": "https://github.com/joaomoreno"
},{
"name":"Evan Oxfeld",
"url": "https://github.com/EvanOxfeld"
},{
"name": "Ulises Gascón",
"url": "https://github.com/ulisesGascon"
}
],
"license": "BSD-2-Clause",
"dependencies": {
"defaults": "^1.0.0",
"fancy-log": "^1.3.2",
"through2": "^0.4.1",
"unzipper": "^0.7.1",
"vinyl": "^1.2.0"
"through2": "3.0.0",
"unzipper": "0.9.10",
"vinyl": "1.2.0"
},
"devDependencies": {
"mocha": "^1.18.0",
"assert-plus": "^0.1.5",
"gulp-concat": "^2.2.0",
"minimatch": "^0.2.14"
"mocha": "5.2.0",
"assert-plus": "1.0.0",
"gulp-concat": "2.6.1",
"minimatch": "3.0.4"
}
}

@@ -1,7 +0,18 @@

[![travis](https://travis-ci.org/inuscript/gulp-unzip.svg)](https://travis-ci.org/inuscript/gulp-unzip)
[![travis](https://travis-ci.org/terrierscript/gulp-unzip.svg)](https://travis-ci.org/terrierscript/gulp-unzip)
![dependencies](https://img.shields.io/david/terrierscript/gulp-unzip.svg)
![devDependencies](https://img.shields.io/david/dev/terrierscript/gulp-unzip.svg)
![Downloads per Week NPM](https://img.shields.io/npm/dw/gulp-unzip.svg)
![Open PRs](https://img.shields.io/github/issues-pr/terrierscript/gulp-unzip.svg)
![Open Issues](https://img.shields.io/github/issues-raw/terrierscript/gulp-unzip.svg)
# gulp-unzip
> gulp plugin for unzip file.
# Usage
### Usage
```bash
npm install gulp-unzip --save
```
```js

@@ -16,5 +27,5 @@ var unzip = require('gulp-unzip')

# Options
### Options
## filter
#### filter

@@ -39,3 +50,3 @@ You can provide a `filter` option. It should be a function that gets an `entry` as an argument and returns `true` or `false`.

## keepEmpty
#### keepEmpty

@@ -48,16 +59,23 @@ You can provide `true` or `false` in `keepEmpty` for whether you want to extract empty files from the archive or not. Defaults to `false`.

.pipe(unzip({ keepEmpty : true }))
...
//...
})
```
# Entry
### Contributors
For more info, go to [node-unzip](https://github.com/EvanOxfeld/node-unzip).
If you want to contribute to the project, please check de [Contribution Guidelines](CONTRIBUTING.md)
- `entry.size`, returns the file size
- `entry.type`, returns `Directory` or `File`
- `entry.path`, returns the file path in the zip file
**Author**
- [terrierscript (@terrierscript)](https://github.com/terrierscript)
# Known issue
- Cause `RangeError: Maximum call stack size exceeded` when open large zip file
- https://github.com/inuscript/gulp-unzip/issues/2
**Maintainers**
- [Ulises Gascón (@ulisesGascon)](https://github.com/ulisesGascon)
**Contributors**
- [Joey Cozza (@joeycozza)](https://github.com/joeycozza)
- [Joe Pettersson (@Joe8Bit)](https://github.com/Joe8Bit)
- [Erik Vold (@erikvold)](https://github.com/erikvold)
- [hami (@hami-jp)](https://github.com/hami-jp)
- [Selwyn (@Selwyn)](https://github.com/Siilwyn)
- [João Moreno (@joaomoreno)](https://github.com/joaomoreno)
- [Evan Oxfeld (@EvanOxfeld)](https://github.com/EvanOxfeld)
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