Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

s3-streamer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3-streamer

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.

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 12 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc