iostreams-s3

0.1.0 • Public • Published

iostreams-s3

Bootstrap stream provider for iostreams

Build Status Coverage Status Dependency Status

Install

$ npm install iostreams iostreams-s3

Usage

var iostreams = require('iostreams');
 
iostreams.use(require('iostreams-s3'));
 
// Getting an input stream
iostreams.getInputStream({
  protocol: 's3:',
  key: process.env.S3_KEY,
  secret: process.env.S3_SECRET,
  bucket: process.env.S3_BUCKET,
  region: 'eu-west-1'
  path: '/non-existent-file.png'
}, function(err, inputStream) {
 
});
 
// Getting an output stream
iostreams.getOutputStream({
  protocol: 's3:',
  key: process.env.S3_KEY,
  secret: process.env.S3_SECRET,
  bucket: process.env.S3_BUCKET,
  region: 'eu-west-1'
  path: '/file-to-be-created.flv',
  'Content-Length': fileSize, // Content-Type MUST be defined
  'Content-Type':   'video/flv',
  'x-amz-acl':      'public-read'
} function(err, outputStream) {
 
});
 
// Getting an input and output stream
iostrams.getInputAndOutputStream(
  inputConfigObject,
  outputConfigObject,
  function(err, inputStream, outputStream) {
    intputStream.pipe(outputStream);
  }
);

Licence

MIT

Dependents (0)

Package Sidebar

Install

npm i iostreams-s3

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • bencevans