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.
$ npm install --save img2webp-bin
const {execFile} = require('child_process');
const img2webp = require('img2webp-bin');
execFile(img2webp, ['frame1.png', 'frame2.png', '-o', 'outout.webp'], () => {
console.log('Image converted!');
});
$ npm install --global img2webp-bin
$ img2webp --help
MIT
Based on Imagemin's gif2webp-bin