抽取TAR, TAR.BZ2, TAR.GZ 和 ZIP 归档:gulp-decompress

jopen 10年前

使用decompress来抽取TAR, TAR.BZ2, TAR.GZ 和 ZIP 归档。

安装

$ npm install --save gulp-decompress

用法

var decompress = require('gulp-decompress');  var gulp = require('gulp');    gulp.task('default', function () {      return gulp.src('*.{tar,tar.bz2,tar.gz,zip}')          .pipe(decompress({ strip: 1 }))          .pipe(gulp.dest('dist'));  });

选项

mode

Type: String

Set mode on the extracted files, i.e { mode: '755' }.

strip

Type: Number

Equivalent to --strip-components for tar.

项目主页:http://www.open-open.com/lib/view/home/1416530318570