Kevin 29b9a0c50c clean && clean html base | 4 years ago | |
---|---|---|
.. | ||
lib | 4 years ago | |
cli.js | 4 years ago | |
index.js | 4 years ago | |
license | 4 years ago | |
package.json | 4 years ago | |
readme.md | 4 years ago |
OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information
You probably want imagemin-optipng
instead.
$ npm install --save optipng-bin
const {promisify} = require('util');
const {execFile} = require('child_process');
const optipng = require('optipng-bin');
const execFileP = promsify(execFile);
(async () => {
await execFile(optipng, ['-out', 'output.png', 'input.png']);
console.log('Image minified!');
})();
$ npm install --global optipng-bin
$ optipng --help