39 lines
694 B
Markdown
39 lines
694 B
Markdown
# mozjpeg-bin [](http://travis-ci.org/imagemin/mozjpeg-bin)
|
|
|
|
> 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
|
|
|
|
```js
|
|
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](https://github.com/imagemin)
|