node package manager

imagemin-jpegoptim

jpegoptim imagemin plugin

imagemin-jpegoptim

jpegoptim imagemin plugin

$ npm install --save imagemin-jpegoptim

See jpegoptim-bin's install section for requirements.

var Imagemin = require('imagemin');
var imageminJpegoptim = require('imagemin-jpegoptim');
 
new Imagemin()
.src('images/*.jpg')
.dest('build/images')
.use(imageminJpegoptim({progressive: true}))
.run();

You can also use this plugin with gulp:

var gulp = require('gulp');
var imageminJpegoptim = require('imagemin-jpegoptim');
 
gulp.task('default', function () {
return gulp.src('images/*.jpg')
.pipe(imageminJpegoptim({progressive: true})())
.pipe(gulp.dest('build/images'));
});

Type: boolean
Default: false

Lossless conversion to progressive.

Type: number

Set maximum image quality factor. (0 - 100)

Type: number or string

Try to optimize file to given size. Target size is specified either in kilo bytes (1 -) or as percentage (1% - 99%).

MIT © imagemin