iostreams-s3
v0.1.0
Published
File stream provider for iostreams
Downloads
2
Maintainers
Readme
iostreams-s3
Bootstrap stream provider for iostreams
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