Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

raptor-pubsub

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raptor-pubsub

Support for Pub/Sub communication in the browser

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
468
increased by18.18%
Maintainers
2
Weekly downloads
 
Created
Source

raptor-pubsub

Super lightweight module to support EventEmitter-based Pub/Sub communication in the browser and on the server.

Installation

npm install raptor-pubsub --save

Usage

Communicating on the global pub/sub channel

var raptorPubsub = require('raptor-pubsub');

// Subscribe to an event
raptorPubsub.on('someEvent', function(arg) {
  // Do something...
});

// Publish an event
raptorPubsub.emit('someEvent', 'Hello World');

Communicating on named pub/sub channels

// Get a reference to named pub/sub channel
var channel = require('raptor-pubsub').channel('my-channel');

// Subscribe to an event
channel.on('someEvent', function(arg) {
  // Do something...
});

// Publish an event
channel.emit('someEvent', 'Hello World');

The global pub/sub channel and named channels are simply EventEmitter instances.

Contributors

Contribute

Pull Requests welcome. Please submit Github issues for any feature enhancements, bugs or documentation problems.

License

Apache License v2.0

FAQs

Package last updated on 17 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc