0.2.0 • Published 3 years ago
imagemin-mozjpeg-jpegtran v0.2.0
imagemin-mozjpeg-jpegtran
Install
$ npm install imagemin-mozjpeg-jpegtran
Usage
const imagemin = require('imagemin');
const imageminMozjpegJpegtran = require('imagemin-mozjpeg-jpegtran');
(async () => {
await imagemin(['images/*.jpg'], {
destination: 'build/images',
plugins: [
imageminMozjpegJpegtran()
]
});
console.log('Images optimized');
})();
API
imageminMozjpegJpegtran(options)(buffer)
Returns a Promise<Buffer>
.
options
copy
Type: string
Default: none
Set copy mode.
none
Copy no extra markers from source filecomments
Copy only comment markersall
Copy all extra markers
optimize
Type: boolean
Default: true
Optimize Huffman table (smaller file, but slow compression)
progressive
Type: boolean
Default: true
false
creates baseline JPEG file.
revert
Type: boolean
Default: false
Revert to standard defaults instead of mozjpeg defaults.
fastCrush
Type: boolean
Default: false
Disable progressive scan optimization.
maxMemory
Type: number
Set the maximum memory to use in kilobytes.
buffer
Type: buffer
Buffer to optimize.
License
MIT © Imagemin, Hideo Matsumoto
0.2.0
3 years ago