nathanpeck / s3-upload-stream

A Node.js module for streaming data to Amazon S3 via the multipart upload API
MIT License
347 stars 46 forks source link

Provide machinery to use this framework without globals. #24

Closed izaakschroeder closed 10 years ago

izaakschroeder commented 10 years ago

Having global shared state is always a bad thing™. So we allow the creation of individual instances of streaming clients, each with their own associated AWS.S3 instance. The new code looks something like:

var client = require('s3-upload-stream')(AWS.S3());
var stream = client.upload({
  bucket: "...",
  key: "..."
})

Backwards compatibility is also shoehorned so those who are using the library can continue to do so just as they were before.

Version bump accordingly.

nathanpeck commented 10 years ago

That's a good improvement. I adjusted the documentation, examples, and tests to use this improved technique, and published as 1.0.6

Thanks

izaakschroeder commented 10 years ago

:+1: