# node-pubsub

> Empowers you node app with simple pub/sub functionality. Good for mocking a pub/sub back-end or writing single instance pub/sub applications.

Latest version **0.1.0** (published 2012-02-24) · 0 weekly downloads

## Install

```sh
npm install node-pubsub
pnpm add node-pubsub
yarn add node-pubsub
bun add node-pubsub
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2012-02-24 |
| First published | 2012-02-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stephan Wallentin |
| Maintainers | swallentin |
| Keywords | node, pubsub, pub-sub, publish, subscribe |

## Links

- npm: https://www.npmjs.com/package/node-pubsub
- npm.io page: https://npm.io/package/node-pubsub

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2012-02-24
- 0.0.1 — 2012-02-24

## README

# node-pubsub 

  A port of bloody-jquery-plugins pubsub functionality. https://github.com/phiggins42/bloody-jquery-plugins

  This is simple pubsub feature to be used in node.

    var hub = require('node-pubsub');

    hub.subscribe('/mychannel', function( message ){
      console.log(message);
    });
    hub.publish('/mychannel', [ { message: 'my message' } ], this);
    
    hub.unsubscribe(['/mychannel']);

## Installation
  
    $ npm install node-pubsub
  
or to install the node-pubsub package globally:

    $ npm install node-pubsub -g

## Quick Start

  The fastest way to get started is to
  
    Install the library:
    
      $npm install node-pubsub
  
    Open up app.js and add:
  
      var hub = require('node-pubsub');
  
      hub.subscribe('/mychannel', function( message ){
        console.log(message);
      });
      hub.publish('/mychannel', [ { message: 'my message' } ], this);
      
      hub.unsubscribe(['/mychannel']);
      
  

## Features
  * Ambiguous communication plugin. 
  * Small API surface. 
  * Publishing of events to a channel
  * Subscribing to events from a channel
  * Unsubscribing from a channel

## TODO
  * Fix require so that it doesn't land as an instance. 
    var hub = require('node-pubsub'); 
  should be 
    var hub = require('node-pubsub').create();

# License

  Being stolen directly from the Dojo Toolkit source/bloody-jquery-plugins, this code is released under a dual AFL/BSD license identical to Dojo proper. See http://dojotoolkit.org/license for more information.

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