jpegoptim-bin

jpegoptim wrapper that makes it seamlessly available as a local dependency

jpegoptim-bin

jpegoptim is a utility for optimizing JPEG files that provides lossless optimization (based on optimizing the Huffman tables) and "lossy" optimization based on setting a maximum quality factor

$ npm install --save jpegoptim-bin
var execFile = require('child_process').execFile;
var jpegOptim = require('jpegoptim-bin').path;
 
var args = [
    '--override',
    '--strip-all',
    '--strip-iptc',
    '--strip-icc',
    '--all-progressive',
    '--dest=build'
    'input.jpg'
];
 
execFile(jpegOptim, args, function (err) {
    if (err) {
        throw err;
    }
 
    console.log('Image minified');
});
$ npm install --global jpegoptim-bin
$ jpegoptim --help

MIT © imagemin