tar.gz decompress plugin
$ npm install --save decompress-targz
var Decompress = require('decompress');
var decompressTargz = require('decompress-targz');
new Decompress()
.src('foo.tar.gz')
.dest('dest')
.use(decompressTargz({strip: 1}))
.run();
You can also use this plugin with gulp:
var decompressTargz = require('decompress-targz');
var gulp = require('gulp');
var vinylAssign = require('vinyl-assign');
gulp.task('default', function () {
return gulp.src('foo.tar.gz')
.pipe(vinylAssign({extract: true}))
.pipe(decompressTargz({strip: 1}))
.pipe(gulp.dest('dest'));
});
Type: number
Default: 0
Remove leading directory components from extracted files.
MIT © Kevin Mårtensson