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

@arcblock/event-hub

Package Overview
Dependencies
Maintainers
0
Versions
269
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/event-hub

A nodejs module for local and remote Inter Process Event

  • 1.18.145
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-73.37%
Maintainers
0
Weekly downloads
 
Created
Source

Event Hub

A module for local and remote Inter Process Event

image

Usage

Install

yarn add @arcblock/event-hub

Server

process.env.ABT_NODE_EVENT_PORT=8888;

require('@arcblock/event-hub/lib/server.js);

Client

// process 1

const Client = require('@arcblock/event-hub/lib/client');

const port = ''; // event-hub server port
const did = ''; // your did
const sk = ''; // your sk

const client = new Client({ port, did, sk, autoConnect: true });

const data = { foo: bar };

client.broadcast('my-event', data);
// process 2

const Client = require('@arcblock/event-hub/lib/client');

const port = ''; // event-hub server port
const did = ''; // your did
const sk = ''; // your sk

const client = new Client({ port, did, sk, autoConnect: true });

client.on('my-event', (data) => {
  // handle data
});

FAQs

Package last updated on 15 Nov 2024

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