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

block-messenger

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

block-messenger - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

9

index.js

@@ -19,9 +19,11 @@ // Create an instance of our factory that makes cars

const MQTT = 'mqtt';
class MessengerFactory {
}
MessengerFactory.prototype.createMessenger = (options) => {
MessengerFactory.prototype.createMessenger = (type, options) => {
switch (options.type) {
case "mqtt":
switch (type) {
case MQTT:
this.messengerClass = require('./src/mqtt-messenger');

@@ -39,1 +41,2 @@ break;

exports.BlockMessenger = MessengerFactory;
exports.MQTT = MQTT;
{
"name": "block-messenger",
"version": "1.0.6",
"version": "1.0.7",
"description": "Message exchange between pipeline blocks",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,3 +11,3 @@ # block-messenger

```options = {type = 'mqtt', ...}```
```type = 'mqtt'```

@@ -21,6 +21,7 @@ To receive messages, listen to event 'message' (topic, message)

const BlockMessenger = require('block-messenger').BlockMessenger;
const MQTT = require('block-messenger').MQTT;
const bm = new BlockMessenger();
const options = {
type: "mqtt",
host: '127.0.0.1',

@@ -36,3 +37,3 @@ port: 1883,

const mqtt = bm.createMessenger(options);
const mqtt = bm.createMessenger(MQTT, options);

@@ -82,3 +83,3 @@ mqtt.on('subscribed', (granted) => {

- Implement kafka-messenger.js (options.type = 'kafka')
- Implement kafka-messenger.js (type = 'kafka')
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