$ npm install --save imagemin-jpegoptim
See jpegoptim-bin's install section for requirements.
const imagemin = require('imagemin');
const imageminJpegoptim = require('imagemin-jpegoptim');
imagemin(['images/*.jpg'], 'build/images', {
use: [
imageminJpegoptim()
]
}).then(() => {
console.log('Images optimized');
});
Returns a promise for a buffer.
Type: boolean
Default: false
Lossless conversion to progressive.
Type: number
Set maximum image quality factor. (0
-100
).
Type: number
string
Try to optimize file to given size. Target size is specified either in kilo bytes (1
-n
) or as percentage (1%
-99%
).
Type: boolean
Default: true
Strip all markers from output file.
Note: If you want to control what markers are stripped, this must be set to false
.
Type: boolean
Default: true
Strip comment markers from output file.
Type: boolean
Default: true
Strip EXIF markers from output file.
Type: boolean
Default: true
Strip IPTC/Photoshop (APP13) markers from output file.
Type: boolean
Default: true
Strip ICC profile markers from output file.
Type: boolean
Default: true
Strip XMP markers markers from output file.
Type: buffer
Buffer to optimize.
MIT © imagemin