
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Gzip plugin for gulp.
npm install --save-dev gulp-gzip
Boolean
Appends .gz
file extension if true. Defaults to true.
gzip({ append: true })
filename.txt
becomes filename.txt.gz
.
String
Appends an arbitrary extension to the filename. Disables append
and preExtension
options.
gzip({ extension: 'zip' }) // note that the `.` should not be included in the extension
filename.txt
becomes filename.txt.zip
.
String
Appends an arbitrary pre-extension to the filename. Disables append
and extension
options.
gzip({ preExtension: 'gz' }) // note that the `.` should not be included in the extension
filename.txt
becomes filename.gz.txt
.
String|Number|Boolean
Minimum size required to compress a file. Defaults to false.
gzip({ threshold: '1kb' })
gzip({ threshold: 1024 })
gzip({ threshold: true })
Object
Options object to pass through to zlib.Gzip. See zlib documentation for more information.
gzip({ gzipOptions: { level: 9 } })
gzip({ gzipOptions: { memLevel: 1 } })
String|Function
Some webserver modules such as nginx gzip_static
looks for example.html.gz
, serve it if it exists, else the original example.html
will be served.
For instance, if example.html
was 2kb, it would be gzipped and example.html.gz
was created.
However, if later example.html
is modified to content less than the threshold, gulp-gzip will only bypass it. Hence, you will end up with a new example.html
yet old example.html.gz
. Your webserver will continue to serve old content (example.html.gz
).
Using this option, gulp-gzip will remove example.html.gz
.
It takes in the same argument as gulp.dest
as in gulp.dest('mydest')
, so it knows where to look for the gzipped files. Defaults to undefined
.
gzip({ threshold: 1024, deleteMode: 'mydest' })
If you have cwd
as in gulp.dest('mydest', { cwd: mycwd })
. You can configure it using deleteModeCwd
.
gzip({ threshold: 1024, deleteMode: 'mydest', deleteModeCwd: mycwd })
Boolean
Some files actually get larger after compression. If true, this option passes along the original, uncompressed file if compression increases the file size. Defaults to false.
gzip({ skipGrowingFiles : true })
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('.'));
});
FAQs
Gzip plugin for gulp.
The npm package gulp-gzip receives a total of 48,578 weekly downloads. As such, gulp-gzip popularity was classified as popular.
We found that gulp-gzip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.