Closed tyke closed 10 years ago
Sure. I'll add an options object that will get passed directly to the gzip stream. That way compression level, chunkSize, etc. can all be set for gzip.
I had implemented those options in my pr, but then just realised that its pointless - default level (6) is most balanced on speed/compression.
Think it's worth adding? I don't see the harm in making the option available.
Actualy i started pr with that problem in mind, but never used it. Its worth, its just couple of locs. Actually i used custom zlib properties once - i had busy logining infrastructure (.5-2m insert/s), and had to put logs in queue with bulk compression. Ive set Z_SYNC_FLUSH and cranked up memLevel, but that was an edge case.
I'd welcome support for a compression level option, too.
Thanks for the input. I'm in the process of adding this feature. Should be out today or tomorrow.
Thanks!
I added a gzipOptions config in version 0.0.8
. This can be used to pass any of the usual options to zlib.Gzip
Example:
var gulp = require('gulp');
var gzip = require('gulp-gzip');
var config = {
gzipOptions: {
level: 9,
memLevel: 9
},
append: true
};
gulp.task('default', function() {
gulp.src('...')
.pipe(gzip(config))
.pipe(gulp.dest('...'));
});
Would love support for compression level