optipng-stream-bin ![Build Status](https://camo.githubusercontent.com/29f1488914492fca45cc322211325078ae2d062d18e48eb71b0c99a85b374c32/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616d6579702f6f707469706e672d73747265616d2d62696e2e706e673f6272616e63683d6d6173746572)
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