pngout optimizes the size of PNG files losslessly
You probably want imagemin-pngout
instead.
$ npm install --save pngout-bin
import {execFile} from 'node:child_process';
import pngout from 'pngout-bin';
execFile(pngout, ['input.png', 'output.png', '-s0', '-k0', '-f0'], error => {
console.log('Image minified!');
});
$ npm install --global pngout-bin
$ pngout --help
MIT © Imagemin