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

node-pm2-events

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pm2-events - npm Package Compare versions

Comparing version 1.2.37 to 1.2.38

2

package.json
{
"name": "node-pm2-events",
"version": "1.2.37",
"version": "1.2.38",
"description": "EventBus for local and decentralized instances of the both for individual nodejs applications and as parts of pm2",

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

@@ -36,2 +36,8 @@ /*

#sendbox = false;
setSendbox(v) {
this.#sendbox = !!v;
}
/**

@@ -257,3 +263,3 @@ * @param {EventBus} eventBus

) return;
console.log('transport on callback', channel, message)
this.#sendbox && console.log('transport on callback', channel, message)
callback(ch, message.data);

@@ -281,3 +287,3 @@ } catch (e) {

});
console.log('transport send', channel, message)
this.#sendbox && console.log('transport send', channel, message)
this.#publisher.publish(channel, message);

@@ -308,3 +314,3 @@ }

#onStateChange = (name, state) => {
// console.log(this.#name, name, 'status:', state)
this.#sendbox && console.log(this.#name, name, 'status:', state)
};

@@ -311,0 +317,0 @@ }

@@ -11,3 +11,8 @@ /*

#connections = new Map();
#sendbox = false;
setSendbox(v) {
this.#sendbox = !!v;
}
/**

@@ -44,3 +49,3 @@ * @param {EventBus} eventBus

this.EventBus.on(channel, (message) => {
console.log('ws catch internal', channel, message)
this.#sendbox && console.log('ws catch internal', channel, message)
this.send(message); // catch internal event and send broadcast to connected clients

@@ -79,7 +84,7 @@ this.EventBus.transport.send(channel, message); // send to other server instances

message = this.stringify(message);
console.log('ws send', message)
this.#sendbox && console.log('ws send', message)
for (let connection of this.#connections.values()) try {
connection.socket.send(message);
} catch (e) {
console.error(e)
this.#sendbox && console.error(e)
}

@@ -102,3 +107,3 @@ }

} catch (e) {
console.error(e)
this.#sendbox && console.error(e)
}

@@ -105,0 +110,0 @@ }

@@ -34,2 +34,5 @@ /*

EventBus.transport.setSendbox(true)
EventBus.websocket.setSendbox(true)
const channelName = 'AweSome';

@@ -36,0 +39,0 @@ EventBus.transport.on(channelName, (channelName, message) => {

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