Created
April 24, 2020 14:57
-
-
Save vilellaj/245a4dade8fb27776e1bed57eef783ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const sharp = require('sharp'); | |
fs.readdirSync('./images').forEach(file => { | |
const buff = fs.readFileSync(`./images/${file}`); | |
sharp(buff).toFile('images/output.webp', (err, info) => { | |
if (err) | |
console.error(err); | |
console.info(info); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment