# bunyan-redis-stream

> Simple Bunyan stream to Redis

Latest version **1.0.1** (published 2015-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install bunyan-redis-stream
pnpm add bunyan-redis-stream
yarn add bunyan-redis-stream
bun add bunyan-redis-stream
```

## 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.1 |
| Published | 2015-07-28 |
| First published | 2015-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris White |
| Maintainers | c.white |
| Keywords | redis, bunyan, log, ioredis |

## Links

- npm: https://www.npmjs.com/package/bunyan-redis-stream
- Repository: https://github.com/crwhite21/bunyan-redis-stream
- Issues: https://github.com/crwhite21/bunyan-redis-stream/issues
- npm.io page: https://npm.io/package/bunyan-redis-stream

## Dependencies (1)

- [json-stringify-safe](https://npm.io/package/json-stringify-safe.md) ^5.0.1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-07-28
- 1.0.0 — 2015-07-27

## README

# bunyan-redis-stream
[![Build Status](https://travis-ci.org/crwhite21/bunyan-redis-stream.svg)](https://travis-ci.org/crwhite21/bunyan-redis-stream)

A lightweight Redis stream for Bunyan that can publish to a channel or push to a list.

## Installation
```bash
npm install bunyan-redis-stream
```

## Usage
### node_redis
```javascript
var bunyan = require('bunyan'),
    redis = require('redis'),
    RedisStream = require('bunyan-redis-stream'),
    client = redis.createClient();

var stream = new RedisStream({
  client : client,
  key    : 'logs',
  type   : 'channel'
});

var logger = bunyan.createLogger({
  name: 'bunyan-redis-stream',
  streams: [{
    type   : 'raw',
    level  : 'trace',
    stream : stream
  }]
});
```

### ioredis
```javascript
var bunyan = require('bunyan'),
    Redis = require('ioredis'),
    RedisStream = require('bunyan-redis-stream'),
    client = new Redis();

var stream = new RedisStream({
  client : client,
  key    : 'logs',
  type   : 'channel'
});

var logger = bunyan.createLogger({
  name: 'bunyan-redis-stream',
  streams: [{
    type   : 'raw',
    level  : 'trace',
    stream : stream
  }]
});
```

## Params
| Name           | Type   | Description                                                                      |
|----------------|--------|----------------------------------------------------------------------------------|
| client         | object | Redis client instance                                                            |
| [key=logs]     | string | Name of Redis list or channel to use                                             |
| [type=channel] | string | Method used in which to store log messages in Redis. Either `list` or `channel`. |

## Running Tests
### General
```bash
npm test
```

### Integration
Integration tests assume that a Redis server is running locally on port 6379 with no auth.

```bash
npm run integration
```

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