# s3-download-stream

> s3 download streams

Latest version **1.1.1** (published 2018-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install s3-download-stream
pnpm add s3-download-stream
yarn add s3-download-stream
bun add s3-download-stream
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-02-22 |
| First published | 2014-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/s3-download-stream) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Maintainers | jb55 |
| Keywords | s3 |

## Links

- npm: https://www.npmjs.com/package/s3-download-stream
- Repository: https://github.com/jb55/s3-download-stream
- Homepage: https://github.com/jb55/s3-download-stream#readme
- Issues: https://github.com/jb55/s3-download-stream/issues
- npm.io page: https://npm.io/package/s3-download-stream

## Dependencies (3)

- [clone](https://npm.io/package/clone.md) ^2.1.1
- [debug](https://npm.io/package/debug.md) ^3.1.0
- [SimpleQueue](https://npm.io/package/SimpleQueue.md) 0.0.1

## Recent versions

- 1.1.1 (latest) — 2018-02-22
- 1.0.0 — 2018-02-08
- 0.1.0 — 2017-10-07
- 0.0.5 — 2015-07-17
- 0.0.4 — 2014-09-04
- 0.0.3 — 2014-09-03
- 0.0.2 — 2014-09-03
- 0.0.1 — 2014-09-03

## README

# s3-download-stream

[![Build Status](https://travis-ci.org/jb55/s3-download-stream.svg)](https://travis-ci.org/jb55/s3-download-stream)

  Very fast concurrent + streaming downloads from S3

## Installation

  Install with npm

    $ npm install s3-download-stream

## Example

```js
var downloader = require('s3-download-stream')
var aws = require('aws-sdk')

// config
var auth = {
  apiVersion: "2006-03-01",
  secretAccessKey: process.env.S3_SECRET_KEY,
  accessKeyId: process.env.S3_ACCESS_KEY
}

//
// params documentation:
// http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property
//
var file = process.env.S3_KEY;
var config = {
  client: new aws.S3(auth),
  concurrency: 6,
  params: {
    Key: file,
    Bucket: process.env.S3_BUCKET
  }
}

// stream
downloader(config)
  .pipe(fs.createWriteStream("/tmp/" + file)
```

## API

### var downloader = require('s3-download-stream')(config)

`config` options:

* `client`: [AWS.S3](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html) instance

* `concurrency`: (default `6`) Number of download workers.

* `chunkSize`: (default `512KB`) multiply this by concurrency to get rough MBps.
  set to `null` to use chunk size chosen by downstream `read(n)` calls (usually `16KB`)

* `params`: See [AWS docs](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property)

## License

    The MIT License (MIT)

    Copyright (c) 2014 William Casarin

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.

---
_Source: https://npm.io/package/s3-download-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
