const sharp = require('sharp') run = async () => { try { await sharp('animated-webp-supported.webp', {animated: true}) .resize(2880) .webp() .toFile('resized.webp') } catch (e) { console.log(e) } } run()