Skip to content

hami-jp/gulp-unzip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

travis

gulp-unzip

gulp plugin for unzip file.

Usage

gulp.task('filter_sample', function(){
  var minimatch = require('minimatch')
  gulp.src("./download/bootstrap-3.1.1-dist.zip")
    .pipe(unzip())
    .pipe(gulp.dest('./tmp'))
})

Options

filter

You can provide a filter option. It should be a function that gets an entry as an argument and returns true or false.

var concat = require('gulp-concat')
var minimatch = require('minimatch')
gulp.task('filter_sample', function(){
  gulp.src("./download/bootstrap-3.1.1-dist.zip")
    .pipe(unzip({
      filter : function(entry){
        return minimatch(entry.path, "**/*.min.css")
      }
    }))
    .pipe(concat("bootstrap.css"))
    .pipe(gulp.dest('./tmp'))
})

keepEmpty

You can provide true or false in keepEmpty for whether you want to extract empty files from the archive or not. Defaults to false.

gulp.task('filter_sample', function(){
  gulp.src("./download/bootstrap-3.1.1-dist.zip")
    .pipe(unzip({ keepEmpty : true }))
    ...
})

Entry

For more info, go to node-unzip.

  • entry.size, returns the file size
  • entry.type, returns Directory or File
  • entry.path, returns the file path in the zip file

Known issue

  • Cause RangeError: Maximum call stack size exceeded when open large zip file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%