0.2.0 • Published 4 years ago
imagemin-mozjpeg-jpegtran v0.2.0
imagemin-mozjpeg-jpegtran 
Install
$ npm install imagemin-mozjpeg-jpegtranUsage
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.
noneCopy no extra markers from source filecommentsCopy only comment markersallCopy 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
4 years ago