s3ify
Writable stream which takes paths and uploads them to S3.
Example
var s3ify = ;var fs = ;var path = ; var s = ; { fs;} var src = 'img/hasselblad.jpg';; s; s; s;
See example/recursive.js for an example which recursively mirrors a directory to S3 using recurse.
Methods
var s = s3ify(opts)
Return a writable stream which uploads file paths written to it. Handles
plain path strings or {src, dest}
objects if the S3 object name should
differ from the source file path.
The following opts
must be passed in:
opts.key
- AWS access key ID.opts.secret
- AWS secret access key.opts.region
- AWS geographic region.opts.bucket
- Existing S3 bucket for uploads.
Events
s.on('skip', function (obj) {})
For every file already existing in the bucket this event fires.
s.on('upload', function (obj) {})
For every file sucessfully uploaded to the bucket this event fires.
s.on('error', function (err) {})
For each error when checking existence of or uploading a file this event fires.
License
MIT