node package manager

imagemin-jpegoptim

jpegoptim imagemin plugin

imagemin-jpegoptim Build Status Build status

jpegoptim imagemin plugin

Install

$ npm install --save imagemin-jpegoptim

See jpegoptim-bin's install section for requirements.

Usage

const imagemin = require('imagemin');
const imageminJpegoptim = require('imagemin-jpegoptim');
 
imagemin(['images/*.jpg'], 'build/images', {
    use: [
        imageminJpegoptim()
    ]
}).then(() => {
    console.log('Images optimized');
});

API

imageminJpegoptim([options])(buffer)

Returns a promise for a buffer.

options

progressive

Type: boolean
Default: false

Lossless conversion to progressive.

max

Type: number

Set maximum image quality factor. (0-100).

size

Type: number string

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

buffer

Type: buffer

Buffer to optimize.

License

MIT © imagemin