2.0.1 • Published 4 years ago
dwebp-bin v2.0.1
dwebp-bin 
WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.
Install
$ npm install dwebp-binWebP requires following libraries on Linux. See detail.
$ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-devUsage
import {execFile} from 'node:child_process';
import dwebp from 'dwebp-bin';
execFile(dwebp, ['input.webp', '-o', 'output.png'], error => {
if (error) {
throw error;
}
console.log('Image is converted!');
});CLI
$ npm install --global dwebp-bin$ dwebp input.webp -o output.png