Skip to content

Instantly share code, notes, and snippets.

@taylorstine
Created March 11, 2017 13:56
Show Gist options
  • Select an option

  • Save taylorstine/53efe5a71d61e8b21e62a49923879837 to your computer and use it in GitHub Desktop.

Select an option

Save taylorstine/53efe5a71d61e8b21e62a49923879837 to your computer and use it in GitHub Desktop.
Resize an image using streams.
import request from "request"
import sharp from 'sharp'
function requestImage(imageUrl) {
const resizer = sharp().resize(500, 500).max();
request(imageUrl).pipe(resizer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment