Giter Club home page Giter Club logo

s3stream's Introduction

s3stream

Thin wrapper over existing libraries to standardize the interface for streaming uploads and downloads from Amazon S3. Supports streaming to/from variables or URLs without using the local filesystem.

Example usage

var AWS = require('aws-sdk');
var S3Stream = require('s3-streamer');

var s3 = new AWS.S3();
var s3stream = new S3Stream(s3);

var s3params = { Bucket: "BUCKET", Key: "KEY" };

// upload a string to s3
s3stream.stringToS3("Hello World", s3params).then(function() {
	console.log('Uploaded: %s', string);
	// do something

	// download the string from s3
	s3stream.stringFromS3(s3params).then(function(string) {
		console.log('Downloaded: %s', string);

		// do something
	});
}).catch(function(err) {
	console.log('Error');

	// error handling
});

Upload Methods

s3stream.urlToS3(url, s3params)

Streams the data from a URL to an S3 object without using local storage. Returns a bluebird promise.

s3stream.stringToS3(string, s3params)

Streams a string to an S3 object. Returns a bluebird promise.

s3stream.localFileToS3(filename, s3params)

Streams a local file to an S3 object. Returns a bluebird promise.

Download Methods

s3stream.stringFromS3(s3params)

Streams an S3 object to a string variable. Returns a bluebird promise that resolves with the string.

s3stream.localFileFromS3(filename, s3params)

Streams an S3 object to a local file. Returns a bluebird promise that resolves with the given filename.

Lower level methods

s3stream.uploadStream(s3params)

Returns a Writable that you can pipe streams to.

s3stream.downloadStream(s3params)

Returns a Readable that you can pipe to other streams.

s3stream's People

Contributors

zwigglers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.