Compress JPEGs by re-encoding to the smallest JPEG quality while keeping perceived visual quality the same and by making sure huffman tables are optimized
You probably want imagemin-jpeg-recompress
instead.
$ npm install --save jpeg-recompress-bin
import {execFile} from 'node:child_process';
import jpegRecompress from 'jpeg-recompress-bin';
execFile(jpegRecompress, ['--quality high', '--min 60', 'input.jpg', 'output.jpg'], error => {
console.log('Image minified');
});
$ npm install --global jpeg-recompress-bin
$ jpeg-recompress --help
MIT © Imagemin