Skip to content

Instantly share code, notes, and snippets.

@fzembow
Created October 12, 2019 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fzembow/ec562776c4d777df1199419d2e6b3050 to your computer and use it in GitHub Desktop.
Save fzembow/ec562776c4d777df1199419d2e6b3050 to your computer and use it in GitHub Desktop.
Script to convert pngts to jpegs
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