node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

mozjpeg

mozjpeg-bin Build Status

mozjpeg is a production-quality JPEG encoder that improves compression while maintaining compatibility with the vast majority of deployed decoders

Install

$ npm install --save mozjpeg

Usage

var execFile = require('child_process').execFile;
var mozjpeg = require('mozjpeg');
 
execFile(mozjpeg, ['-outfile', 'output.jpg', 'input.jpg'], function (err) {
    console.log('Image minified!');
});

CLI

$ npm install --global mozjpeg
$ mozjpeg --help

License

MIT © imagemin