gulp-gzip

Gzip plugin for gulp.

npm install gulp-gzip
73 downloads in the last day
386 downloads in the last week
987 downloads in the last month

gulp-gzip

Gzip plugin for gulp.

Install

npm install --save-dev gulp-gzip

Options

append Boolean

Appends .gz file extension if true. Defaults to true.

 gzip({ append: true })

threshold String|Number|Boolean

Minimum size required to compress a file. Defaults to false.

gzip({ threshold: '1kb' })
gzip({ threshold: 1024 })
gzip({ threshold: true })

Examples

var gulp = require("gulp");
var gzip = require("gulp-gzip");

gulp.task("compress", function() {
    gulp.src("./dev/scripts/*.js")
    .pipe(gzip())
    .pipe(gulp.dest("./public/scripts"));
});
var gulp = require("gulp");
var coffee = require("gulp-coffee");
var concat = require("gulp-concat");
var uglify = require("gulp-uglify");
var gzip = require("gulp-gzip");

gulp.task("deployScripts", function() {
    gulp.src("./dev/scripts/*.coffee")
    .pipe(coffee())
    .pipe(concat("all.js"))
    .pipe(uglify())
    .pipe(gzip())
    .pipe(gulp.dest("./public/scripts"));
});
var gulp = require("gulp");
var tar = require("gulp-tar");
var gzip = require("gulp-gzip");

gulp.task("tarball", function() {
    gulp.src("./files/*")
    .pipe(tar("archive.tar"))
    .pipe(gzip())
    .pipe(gulp.dest("."));
});
npm loves you