Skip to content

Instantly share code, notes, and snippets.

@RcrdBrt
Last active November 13, 2016 15:46
Show Gist options
  • Save RcrdBrt/1aa5c1f6e3915fdc70a77ca7fe0d25de to your computer and use it in GitHub Desktop.
Save RcrdBrt/1aa5c1f6e3915fdc70a77ca7fe0d25de to your computer and use it in GitHub Desktop.
const sharp = require('sharp');
const path = require('path');
if(process.argv.length < 3) {
console.log('You must provide an image as a cmd-line argument!');
process.exit(-1);
}
sharp(process.argv[2]).toFile(''+ process.argv[2].slice(0, process.argv[2].indexOf('.'))+'.jpg');
console.log('Done!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment