# firehose-writer

> Provides a buffered queue abstraction for writing to AWS [Firehose](https://aws.amazon.com/kinesis/data-firehose/).

Latest version **0.2.0** (published 2018-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install firehose-writer
pnpm add firehose-writer
yarn add firehose-writer
bun add firehose-writer
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-03-23 |
| First published | 2018-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.2 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | shapigor |

## Links

- npm: https://www.npmjs.com/package/firehose-writer
- Repository: https://github.com/WisePricer/firehose-writer
- Homepage: https://github.com/WisePricer/firehose-writer#readme
- Issues: https://github.com/WisePricer/firehose-writer/issues
- npm.io page: https://npm.io/package/firehose-writer

## Dependencies (1)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.209.0

## Recent versions

- 0.2.0 (latest) — 2018-03-23
- 0.1.0 — 2018-03-22
- 0.1.11-0 — 2018-03-15
- 0.1.6-0 — 2018-03-15
- 0.1.5-0 — 2018-03-15

## README

# Firehose writer

Provides a buffered queue abstraction for writing to AWS [Firehose](https://aws.amazon.com/kinesis/data-firehose/).

Handles the following:
- Buffering
  - by time
  - by size
  - by count
- Retries

# Install

```sh
npm install firehose-writer
```

# Usage

```js
const FirehoseWriter = require('firehose-writer')

const writer = new FirehoseWriter({
  streamName: 'some-stream'// Name of the delivery stream

  // [Optional]
  // Specifies a log function to call
  // Callaback params:
  //    level: warn|error
  //    message: description of the error
  //    params: additional data to complement the error
  log: function(level, message, params) {
  }

  firehoseClient: ...,     // [Optional] override firehose client

  maxTimeout: 10000        // Flush records after 10 seconds, default: 10000ms (10 seconds)
  maxSize: 1               // Flush records after 1 Byte of data accumulated, default: 4 000 000
  maxCount: 400            // Flush records after 400 records buffered, default: 500 records

  maxRetries: 10           // Max delivery attempts for failed records/batches, default: 10 retries

  maxBatchCount: 500       // Max size of the delivery batch (cannot exceed 500). Default: 500
  maxBatchSize: 1000000    // Max batch size in bytes (can not exceed 4Mb). Default: 4 000 000
})

writer.put({ foo: 'bar' })
```

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