Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

optipng-bin

imagemin1.5mMIT9.0.0

OptiPNG wrapper that makes it seamlessly available as a local dependency

imagemin, compress, image, minify, optimize, png, optipng

readme

optipng-bin GitHub Actions Status

OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information

You probably want imagemin-optipng instead.

Install

$ npm install --save optipng-bin

Usage

import {execFile} from 'node:child_process';
import optipng from 'optipng-bin';

execFile(optipng, ['-out', 'output.png', 'input.png'], error => {
    console.log('Image minified!');
});

CLI

$ npm install --global optipng-bin
$ optipng --help