Skip to content

Instantly share code, notes, and snippets.

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 transitive-bullshit/5bb75866d74663afec243c8fce4dd332 to your computer and use it in GitHub Desktop.
Save transitive-bullshit/5bb75866d74663afec243c8fce4dd332 to your computer and use it in GitHub Desktop.
const axios = require('axios');
async function main () {
const url = 'https://octodex.github.com/images/original.png';
const optimized = await axios.post('https://ssfy.sh/dev/imagemin/optimizeImageUrl', { url }, {
responseType: 'arraybuffer'
});
console.log('optimized', { status: optimized.status, size: optimized.data.length });
return optimized;
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment