Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noblesamurai/s3streamer
Stream objects from S3.
https://github.com/noblesamurai/s3streamer
Last synced: about 1 month ago
JSON representation
Stream objects from S3.
- Host: GitHub
- URL: https://github.com/noblesamurai/s3streamer
- Owner: noblesamurai
- License: other
- Created: 2015-04-22T02:45:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-23T06:00:52.000Z (over 9 years ago)
- Last Synced: 2024-04-22T05:21:50.471Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 168 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s3streamer
Stream objects from S3.
[![build status](https://secure.travis-ci.org/timothyleslieallen/s3streamer.png)](http://travis-ci.org/timothyleslieallen/s3streamer)
## Installation
This module is installed via npm:
``` bash
$ npm install s3streamer
```## Example Usage
``` js
var s3streamer = require('s3streamer')(s3credentials);var objectKeys = s3streamer.objectKeys({Bucket: process.env.BUCKET, Prefix: 'myprefix'});
// {key: 'blah', bucket: 'thebucketyougave'}, ...var getObjects = objectKeys.pipe(s3streamerer.getObject());
// {key: 'blah', body: 'contents...'}, ...```
s3credentials are passed in to: `new AWS:S3(s3credentials)`, cf Amazon doco here: (http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html)## Tests
To run the tests you will need some valid S3 credentials and a corresponding bucket. Ensure the bucket has at least one object with a key prefixed by `exists`.
Run like so:
``` js
S3_REGION='us-east-1' S3_ACCESS_KEY_ID='mykeyid' S3_SECRET_ACCESS_KEY='mysecretaccesskey' BUCKET='mybucket' npm test
```