JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 204536
  • Score
    100M100P100Q181011F

cwebp node.js wrapper that convert JPG or PNG into WebP

Package Exports

  • cwebp-bin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cwebp-bin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-cwebp-bin

Build Status NPM version Dependency Status devDependency Status

Dependency

WebP requires following libraries. See detail.

Linux

$ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev

Mac OS X

$ sudo port install jpeg libpng tiff giflib

Install

$ npm install --save cwebp-bin

Usage

var execFile = require('child_process').execFile;
var cwebp = require('cwebp-bin').path;

execFile(cwebp, ['input.png', '-o', 'output.webp'], function (error) {
  if (error) {
    throw error;
  }

  console.log('Image was converted');
});

License

This is licensed under BSD. WebP is licensed under Creative Commons Attribution 3.0 License.