iostreams-s3

File stream provider for iostreams

iostreams-s3

Bootstrap stream provider for iostreams

$ npm install iostreams iostreams-s3
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(errinputStream) {
 
});
 
// 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(erroutputStream) {
 
});
 
// Getting an input and output stream 
iostrams.getInputAndOutputStream(
  inputConfigObject,
  outputConfigObject,
  function(errinputStreamoutputStream) {
    intputStream.pipe(outputStream);
  }
);

MIT