Skip to content

Instantly share code, notes, and snippets.

@buroz
Created June 4, 2019 06:34
Show Gist options
  • Save buroz/2d202699bda749574a9b7eeaf8309b56 to your computer and use it in GitHub Desktop.
Save buroz/2d202699bda749574a9b7eeaf8309b56 to your computer and use it in GitHub Desktop.
import sharp from 'sharp'
import { createWriteStream } from 'fs'
let wstream = createWriteStream('resized.jpg');
sharp('muscle.jpg')
.rotate()
.resize(200)
.toBuffer()
.then( data => { wstream.write(data) })
.catch( err => { console.log(err) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment