@mole-inc/cwebp-bin

cwebp wrapper that makes it seamlessly

Usage no npm install needed!

<script type="module">
  import moleIncCwebpBin from 'https://cdn.skypack.dev/@mole-inc/cwebp-bin';
</script>

README

cwebp-bin Node CI

WebP is a new image format that provides lossless and lossy compression for images on the web. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at equivalent SSIM index.

You probably want imagemin-webp instead.

Downloads Version codecov

Install

$ npm install @mole-inc/cwebp-bin

Usage

import {execFile} from 'child_process';
import {cwebpBin} from '@mole-inc/cwebp-bin';

execFile(cwebpBin.path, ['input.png', '-o', 'output.webp'], err => {
    if (err) {
        throw err;
    }

    console.log('Image is converted!');
});

CLI

$ npm install --global @mole-inc/cwebp-bin
$ cwebp --help

License

This is a fork of imagemin/cwebp-bin licensed under the MIT License.

see license file and vendor/cwebp-license.txt file.