optipng-stream-bin

Wrapper around optipng-bin for use with stdin/stdout

MIT 7 个版本
安装
npm install optipng-stream-bin
yarn add optipng-stream-bin
pnpm add optipng-stream-bin
bun add optipng-stream-bin
README

optipng-stream-bin Build Status

Issues with the output should be reported on the image-min issue tracker.

This is a wrapper around node-optipng-bin to add support for reading input PNG data from STDIN and writing the generated output PNG data to STDOUT. The module is intended to be used only as a binary in the same style as modules that use bin-wrapper. It cannot be used in any other fashion.

Usage

var fs = require('fs');
var optipng = require('optipng-stream-bin').path;
var spawn = require('child_process').spawn;

var cp = spawn(optipng, ['-o2']);
var read = fs.createReadStream('test.png');
var write = fs.createWriteStream('test-optimized.png');

read.pipe(cp.stdin);
cp.stdout.pipe(write);

License

MIT © Amey Parulekar

版本列表
0.0.7 2014-03-31
0.0.6 2014-03-31
0.0.5 2014-03-02
0.0.4 2014-03-02
0.0.3 2014-02-28
0.0.2 2014-02-28
0.0.1 2014-02-28