You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 812B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # optipng-bin [![Build Status](https://travis-ci.org/imagemin/optipng-bin.svg?branch=master)](https://travis-ci.org/imagemin/optipng-bin)
  2. > [OptiPNG](http://optipng.sourceforge.net) is a PNG optimizer that recompresses image files to a smaller size, without losing any information
  3. You probably want [`imagemin-optipng`](https://github.com/imagemin/imagemin-optipng) instead.
  4. ## Install
  5. ```
  6. $ npm install --save optipng-bin
  7. ```
  8. ## Usage
  9. ```js
  10. const {promisify} = require('util');
  11. const {execFile} = require('child_process');
  12. const optipng = require('optipng-bin');
  13. const execFileP = promsify(execFile);
  14. (async () => {
  15. await execFile(optipng, ['-out', 'output.png', 'input.png']);
  16. console.log('Image minified!');
  17. })();
  18. ```
  19. ## CLI
  20. ```
  21. $ npm install --global optipng-bin
  22. ```
  23. ```
  24. $ optipng --help
  25. ```