Created
March 11, 2017 13:56
-
-
Save taylorstine/53efe5a71d61e8b21e62a49923879837 to your computer and use it in GitHub Desktop.
Resize an image using streams.
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
| 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