Skip to content

Instantly share code, notes, and snippets.

@jbilcke
Created September 12, 2013 13:26
Show Gist options
  • Save jbilcke/6537280 to your computer and use it in GitHub Desktop.
Save jbilcke/6537280 to your computer and use it in GitHub Desktop.
"It is possible to stream a request directly to a Node.js Stream object by calling the createReadStream() method on a request. " http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/makingrequests.html
(new AWS.S3()).getObject(Bucket: 'myBucket', Key: 'myImageFile.jpg').createReadStream().pipe(require('fs').createWriteStream('/path/to/file.jpg'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment