Streaming upload to S3
Version 0.2.x using ManagedUpload API. NodeJS 0.10 and 0.12 supported.
Version 0.1.x using MultiPartUpload API. NodeJS 0.8 and 0.10 supported.
Installation is done via NPM, by running
npm install s3-streaming-upload
- Super easy to use
- No need to know data size beforehand
- Stream is buffered up to specified size (default 5MBs) and then uploaded to S3
- Segments are not written to disk and memory is freed as soon as possible after upload
- Uploading is asynchronous
- You can react to upload status through events
var Uploader = require's3-streaming-upload'Uploaderupload = nullstream = require'fs'createReadStream'/etc/resolv.conf';upload =// credentials to access AWSaccessKey: processenvAWS_S3_ACCESS_KEYsecretKey: processenvAWS_S3_SECRET_KEYbucket: processenvAWS_S3_TEST_BUCKETobjectName: "myUploadedFile"stream: streamdebug: true;uploadsendif errconsole.error'Upload error' + err;;
Pass it in
objectParams to the
upload =// credentials to access AWSaccessKey: processenvAWS_API_KEYsecretKey: processenvAWS_SECRETbucket: processenvAWS_S3_TRAFFIC_BACKUP_BUCKETobjectName: "myUploadedFile"stream: streamobjectParams:ACL: 'public-read';