# redis-liveset

> Redis LiveSet - a wrapper arround Redis Set with realtime notifications

Latest version **0.2.1** (published 2019-06-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install redis-liveset
pnpm add redis-liveset
yarn add redis-liveset
bun add redis-liveset
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-06-01 |
| First published | 2017-12-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 58.9 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | lostintime |
| Maintainers | lostintime |
| Keywords | redis, pub/sub, Set |

## Links

- npm: https://www.npmjs.com/package/redis-liveset
- Repository: https://github.com/lostintime/node-redis-liveset
- Homepage: https://github.com/lostintime/node-redis-liveset#readme
- Issues: https://github.com/lostintime/node-redis-liveset/issues
- npm.io page: https://npm.io/package/redis-liveset

## Dependencies (4)

- [redis](https://npm.io/package/redis.md) 2.8.0
- [redux](https://npm.io/package/redux.md) 4.0.1
- [immutable](https://npm.io/package/immutable.md) 3.8.2
- [typematcher](https://npm.io/package/typematcher.md) 0.4.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

- 0.2.1 (latest) — 2019-06-01
- 0.2.0 — 2017-12-06
- 0.1.3 — 2017-12-05
- 0.1.2 — 2017-12-05
- 0.1.1 — 2017-12-05
- 0.1.0 — 2017-12-05

## README

Redis LiveSet
=============

A type-safe Redis wrapper to keep a [Set](https://redis.io/topics/data-types#sets) _eventually_ synchronized across multiple nodes.


## Installation

```bash
npm install --save redis-liveset
```

## Usage examples

Listening for updates

```typescript
import { createNumbersLiveSet } from "redis-liveset"
import * as redis from "redis"
import { Set } from "immutable"

const sub = redis.createClient()
const pub = redis.createClient()

const liveSet = createNumbersLiveSet("my-super-channel", pub, sub)

liveSet.subscribe((s: Set<number>) => {
  console.log("Set changed: ", s)
})
```

Changing Set

```typescript
import { createNumbersLiveSet } from "redis-liveset"
import * as redis from "redis"

const sub = redis.createClient()
const pub = redis.createClient()

const liveSet = createNumbersLiveSet("my-super-channel", pub, sub)
liveSet.clear()
liveSet.replaceAll([5,6,7])
liveSet.add(1)
liveSet.addAll([10,11])
liveSet.remove(5)
```

## Contribute

> Perfection is Achieved Not When There Is Nothing More to Add, 
> But When There Is Nothing Left to Take Away

Fork, Contribute, Push, Create pull request, Thanks.

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