# redis-namespaced-pubsub

> Allows you to broadcast and subscribe messages prefixed by a namespace. The message names are separated by columns into namespaces. An example message name could be "u:employee:joe:gotpaid". Any subscriber subscribed to any of "u:*", "u:employee:*", "u:e

Latest version **4.0.1** (published 2015-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-namespaced-pubsub
pnpm add redis-namespaced-pubsub
yarn add redis-namespaced-pubsub
bun add redis-namespaced-pubsub
```

## 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 | 4.0.1 |
| Published | 2015-12-04 |
| First published | 2015-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | Filippo Ghibellini |
| Maintainers | fghibellini |
| Keywords | redis, pubsub, namespace |

## Links

- npm: https://www.npmjs.com/package/redis-namespaced-pubsub
- Repository: https://github.com/fghibellini/redis-namespaced-pubsub
- Issues: https://github.com/fghibellini/redis-namespaced-pubsub/issues
- npm.io page: https://npm.io/package/redis-namespaced-pubsub

## Dependencies (2)

- [redis](https://npm.io/package/redis.md) 0.12.1
- [lodash](https://npm.io/package/lodash.md) 3.1.0

## 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

- 4.0.1 (latest) — 2015-12-04
- 4.0.0 — 2015-03-30
- 3.0.0 — 2015-03-18
- 2.0.0 — 2015-02-05
- 1.0.0 — 2015-02-05

## README

# redis-namespaced-pubsub

Allows you to broadcast and subscribe messages prefixed by a namespace.
The message names are separated by columns into namespaces.
An example message name could be "u:employee:joe:gotpaid".
Any subscriber subscribed to any of "u:*", "u:employee:*",  "u:employee:joe:*" or
"u:employee:joe:gotpaid" would receive such message.

## Usage

    // all the messages will be prefixed by u:namespace1:
    var redis = require("redis-namespaced-pubsub")({namespace: "u:namespace1:"});

    subscriber = new redis.Subscriber(["routes:*", "deliveries:*"]);
    publisher = new redis.Publisher();

    var route = {};

    subscriber.on("update", function(eventName, data) {
        data.should.eql(route);
    });

    setTimeout(function() {
        publisher.publish("routes:123456:patch", route);
    }, 300);

    // alternatively
    subscriber = new updates.Subscriber(["routes:*", "deliveries:*"], function(eventName, data) {
        data.should.eql(route);
    });

See tests for more examples.

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