New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

elbus-client

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
Package was removed
Sorry, it seems this package was removed from the registry

elbus-client

javascript client for elbus

unpublished
latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

javascript client for elbus

JavaScript client for elbus

Client example:

const elbus = require("elbus");

async function on_disconnect() {
  console.log("elbus disconnected");
}

async function on_frame(frame) {
  console.log(frame, frame.get_payload().toString());
}

async function main() {
  // connect
  let bus = new elbus.Client("js");
  bus.on_disconnect = on_disconnect;
  bus.on_frame = on_frame;
  await bus.connect("/tmp/elbus.sock");

  // subscribe to topics
  let frame = new elbus.Frame(elbus.OP_SUBSCRIBE, 1);
  frame.topic = ["some/topic1", "topic2"];
  let op = await bus.send(frame);
  console.log(await op.wait_completed());

  // send one-to-one message
  let msg = new elbus.Frame(elbus.OP_MESSAGE, 1);
  msg.payload = Buffer.from("hello");
  let op = await bus.send("target", msg);
  console.log(await op.wait_completed());

  // disconnect
  bus.disconnect();
}

main()

Keywords

elbus

FAQs

Package last updated on 09 Jan 2022

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