# bragg-cloudwatch

> CloudWatch middleware for bragg

Latest version **1.0.0** (published 2016-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install bragg-cloudwatch
pnpm add bragg-cloudwatch
yarn add bragg-cloudwatch
bun add bragg-cloudwatch
```

## 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 | 1.0.0 |
| Published | 2016-07-15 |
| First published | 2016-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Sam Verschueren |
| Maintainers | samverschueren |
| Keywords | bragg, framework, cloudwatch, logs, stream, events, aws, lambda, serverless |

## Links

- npm: https://www.npmjs.com/package/bragg-cloudwatch
- Repository: https://github.com/samverschueren/bragg-cloudwatch
- Homepage: https://github.com/samverschueren/bragg-cloudwatch#readme
- Issues: https://github.com/samverschueren/bragg-cloudwatch/issues
- npm.io page: https://npm.io/package/bragg-cloudwatch

## Dependencies (1)

- [pify](https://npm.io/package/pify.md) ^2.3.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-07-15

## README

# bragg-cloudwatch [![Build Status](https://travis-ci.org/SamVerschueren/bragg-cloudwatch.svg?branch=master)](https://travis-ci.org/SamVerschueren/bragg-cloudwatch)

> CloudWatch middleware for [bragg](https://github.com/SamVerschueren/bragg).

This little piece of middleware makes it possible to handle a CloudWatch logstream as if they where normal requests.


## Install

```
$ npm install --save bragg-cloudwatch
```


## Usage

```js
const app = require('bragg')();
const router = require('bragg-router')();
const cloudwatch = require('bragg-cloudwatch');

// Listen for the logstream with the filter name `unicorn`
router.post('dynamodb:unicorn', ctx => {
	console.log(ctx.request.body);
	//=> [{id: 'eventId1', timestamp: 1440442987000, message: '[ERROR] First error message'}]
});

app.use(cloudwatch());
app.use(router.routes());

exports.handler = app.listen();
```

The `cloudwatch:` prefix is attached by this module and is followed by the name of the filter. The event is provided in the `body` property of the `request` object.


## API

### cloudwatch([options])

#### options

Type: `Object`

Map a filter name to another name.


## Related

- [bragg-sns](https://github.com/SamVerschueren/bragg-sns) - SNS middleware.
- [bragg-dynamodb](https://github.com/SamVerschueren/bragg-dynamodb) - DynamoDB middleware.


## License

MIT © [Sam Verschueren](https://github.com/SamVerschueren)

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