🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@lejeunerenard/kappa-core-event-bus

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lejeunerenard/kappa-core-event-bus

A peer-to-peer event bus.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Kappa Event Bus

A kappa-core based event bus node for sending messages to all nodes on a peer-to-peer network. This creates a network wide event emitter with eventual consistency.

Usage

Node A

const EventBus = require('@lejeunerenard/kappa-core-event-bus')

const bus = new EventBus('network-name')

const data = {
  foo: 'bar'
}

bus.emit('event-name', data)

Node B

const EventBus = require('@lejeunerenard/kappa-core-event-bus')

const bus = new EventBus('network-name')
bus.on('event-name', (data) => {
  console.log('foo', data.foo) // prints: bar
})

License

ISC

Keywords

kappa-core

FAQs

Package last updated on 17 Jan 2021

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