Created
October 12, 2019 17:14
-
-
Save fzembow/ec562776c4d777df1199419d2e6b3050 to your computer and use it in GitHub Desktop.
Script to convert pngts to jpegs
This file contains hidden or 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 glob = require('glob'); | |
const sharp = require('sharp'); | |
glob('./*.png', {}, async (e, filenames) => { | |
filenames.forEach(filename => { | |
sharp(filename) | |
.toFile(`${filename.replace(/\.png$/, '')}.jpeg`); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment