<commit_before># s3-stream-download

  [![shippable Build][shippable-image]][shippable-url]
  [![NPM Version][npm-image]][npm-url]
  [![NPM Downloads][downloads-image]][downloads-url]

Multipart streaming download from S3

## Features

## Installation

``` bash
  $ npm install s3-stream-download --save
```

## Usage

```js
var AWS = require('aws-sdk');
var S3StreamDownload = require('./index');
var fs = require('fs');

var s3 = new AWS.S3();

var s3StreamDownload = new S3StreamDownload(s3, {Bucket: '<BUCKET>', Key:'<KEY>'});

s3StreamDownload.pipe(fs.createWriteStream('<FILENAME>'));

s3StreamDownload.on('end', function() {
    process.exit(0);
});
```

## Documentation

### new S3StreamDownload(s3, s3Params, options)

Creates a new instance of a multipart download stream.  This is a readable stream that can be
piped into other streams.

__Arguments__

* `s3` - Configured aws-sdk s3 instance.  Should be preconfigured with any credentials.
* `s3Params` - Params object that would normally be passed to s3.getObject()
* `options` - Options
    - `downloadChunkSize` - Size of each chunk in bytes.  Defaults to 5MB.
    - `concurrentChunks` - Number of chunks to download concurrently. Defaults to 5.
    - `retries` - How many times a failed chunk should be retried before failing the entire download. Retries will exponentially backoff to allow for recovery.  Defaults to 5.



## People

The author is [<NAME>](https://github.com/chriskinsman) from [PushSpring](http://www.pushspring.com)

## License

  [MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/s3-stream-download.svg?style=flat
[npm-url]: https://npmjs.org/package/s3-stream-download
[downloads-image]: https://img.shields.io/npm/dm/s3-stream-download.svg?style=flat
[downloads-url]: https://npmjs.org/package/s3-stream-download
[shippable-image]: https://img.shields.io/shippable/chriskinsman/s3-stream-download.svg
[shippable-url]: https://app.shippable.com/projects/57bfbd4c016a370e00eb8907<commit_msg>Change to shippable internal badge<commit_after># s3-stream-download

  [![shippable Build][shippable-image]][shippable-url]
  [![NPM Version][npm-image]][npm-url]
  [![NPM Downloads][downloads-image]][downloads-url]

Multipart streaming download from S3

## Features

## Installation

``` bash
  $ npm install s3-stream-download --save
```

## Usage

```js
var AWS = require('aws-sdk');
var S3StreamDownload = require('./index');
var fs = require('fs');

var s3 = new AWS.S3();

var s3StreamDownload = new S3StreamDownload(s3, {Bucket: '<BUCKET>', Key:'<KEY>'});

s3StreamDownload.pipe(fs.createWriteStream('<FILENAME>'));

s3StreamDownload.on('end', function() {
    process.exit(0);
});
```

## Documentation

### new S3StreamDownload(s3, s3Params, options)

Creates a new instance of a multipart download stream.  This is a readable stream that can be
piped into other streams.

__Arguments__

* `s3` - Configured aws-sdk s3 instance.  Should be preconfigured with any credentials.
* `s3Params` - Params object that would normally be passed to s3.getObject()
* `options` - Options
    - `downloadChunkSize` - Size of each chunk in bytes.  Defaults to 5MB.
    - `concurrentChunks` - Number of chunks to download concurrently. Defaults to 5.
    - `retries` - How many times a failed chunk should be retried before failing the entire download. Retries will exponentially backoff to allow for recovery.  Defaults to 5.



## People

The author is [<NAME>](https://github.com/chriskinsman) from [PushSpring](http://www.pushspring.com)

## License

  [MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/s3-stream-download.svg?style=flat
[npm-url]: https://npmjs.org/package/s3-stream-download
[downloads-image]: https://img.shields.io/npm/dm/s3-stream-download.svg?style=flat
[downloads-url]: https://npmjs.org/package/s3-stream-download
[shippable-image]: https://api.shippable.com/projects/57bfbd4c016a370e00eb8907/badge?branch=master
[shippable-url]: https://app.shippable.com/projects/57bfbd4c016a370e00eb8907
{'fraction_non_alphanumeric': 0.1455317024463305, 'fraction_numerical': 0.024463305042436344, 'mean_word_length': 4.691761363636363, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 45, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3242607', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1326, 'n_words': 329}