oxipng bin-wrapper that makes it seamlessly available as a local dependency
npm install oxipng-bin> This is a bin wrapper for OxiPNG for use with imagemin and the imagemin-oxipng plugin.
You probably want the @vheemstra/imagemin-oxipng plugin instead.
``sh`
npm install --save oxipng-bin
`js
import {execFile} from 'node:child_process';
import oxipng from 'oxipng-bin';
execFile(oxipng, [
'--opt', '4',
'--strip', 'safe',
'--out', 'output.png',
'input.png'
], err => {
if (err) {
throw err;
}
console.log('Image optimized!');
});
`
`sh`
npm install --global oxipng-bin
`sh``
oxipng --help
MIT © Imagemin
OxiPNG by Josh Holmer (Open-source software, distributed under the MIT license.)
This package is made by Philip van Heemstra
Based on jpegtran-bin by Sindre Sorhus
Info on building oxipng binaries