# @metarouter/emitter-s3

> Emits an array of JSON object to an Amazon S3 file.

Latest version **3.0.0** (published 2019-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @metarouter/emitter-s3
pnpm add @metarouter/emitter-s3
yarn add @metarouter/emitter-s3
bun add @metarouter/emitter-s3
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2019-06-05 |
| First published | 2019-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Alois Barreras |
| Maintainers | klepert, thisisamurray |

## Links

- npm: https://www.npmjs.com/package/@metarouter/emitter-s3
- npm.io page: https://npm.io/package/@metarouter/emitter-s3

## Dependencies (2)

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

## Recent versions

- 3.0.0 (latest) — 2019-06-05

## README

# emitter-s3

Wrapper for the AWS.S3 client that will emit an array or stream of JSON object to an s3 file.

## Creating an Emitter

Import the S3Emitter from 'emitter-s3' and pass in an options object to the constructor.

```javascript
const S3Emitter = require('emitter-s3');

const options = {
    filePath: 'my/file/path',
    bucketName: 'my_bucket',
    region: 'us-east-1',
    awsAccessKeyId: 'accessKeyId',
    awsSecretAccessKey: 'secretAccessKey'
};

const emitter = new S3Emitter(options);
```

## Options

### filePath (optional)

The file path at which your s3 files will be stored.

### appendTimestampToFilename

Default: true

By default, this will make the filename an ISO formatted date string. You can use filePath to create a path prefix with the filename as the timestamp.

### bucketName

The name of your S3 bucket.

### region

The region in which your S3 bucket is.

### serverSideEncryption (optional)

AWS S3 supports [server side encryption](http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html). If your bucket policy requires the server side encryption header to be set, you can specify that here.

Possible values are 'AES256' or 'aws:kms'.

## API

### .emit(records)

Emits the data to an s3 file. Returns a promise.

```javascript
await emitter.emit(data);

// or with promises
emitter.emit(data).then(function () {
    // do something after uploading file
});
```

## License

Released under the MIT License.

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