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

@wedevelop/web-sub

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wedevelop/web-sub

WebSub client for Node.js.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
4
Weekly downloads
 
Created
Source

web-sub

JavaScript Style Guide

Simple WebSub client for Node.js. It provides publish and subscribe methods.

Installation

Also, you'll need to install an adapter. For the moment the only available adapter is web-sub-kafka-adapter.

This package could be extended to use any other apdater such as RabbitMQ, SQS, ActiveMQ, etc.

npm install --save @wedevelop/web-sub @wedevelop/web-sub-kafka-adapter

Quick start

const WebSubClient = require('@wedevelop/web-sub')
const KafkaAdapter = require('@wedevelop/web-sub-kafka-adapter')

const topic = 'demo'
const webSubClient = new WebSubClient(new KafkaAdapter())

webSubClient.publish([{ topic, messages: [new Date()] }])
  .then(console.log)
  .catch(console.error)

webSubClient.subscribe(topic, (err, data) => {
  if (err) {
    console.error(err)
  } else {
    console.log(data)
  }
})

Keywords

FAQs

Package last updated on 27 Feb 2019

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