oxipng-bin
Version:
oxipng bin-wrapper that makes it seamlessly available as a local dependency
53 lines (36 loc) • 1.3 kB
Markdown
> This is a bin wrapper for [OxiPNG](https://github.com/shssoichiro/oxipng) for use with [`imagemin`](https://github.com/imagemin/imagemin) and the [`imagemin-oxipng`](https://github.com/vheemstra/imagemin-oxipng) plugin.
You probably want the [`@vheemstra/imagemin-oxipng`](https://github.com/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](https://github.com/imagemin)<br>
[](https://github.com/shssoichiro/oxipng) by [Josh Holmer](https://github.com/shssoichiro) (Open-source software, distributed under the MIT license.)<br>
This package is made by [Philip van Heemstra](https://github.com/vHeemstra)<br>
Based on [jpegtran-bin](https://github.com/imagemin/jpegtran-bin) by [Sindre Sorhus](https://github.com/sindresorhus)<br>
[](https://github.com/vHeemstra/oxipng-bin/blob/main/vendor/build-oxipng.md)