New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.29 to 1.2.31

4

package.json
{
"name": "node-pm2-events",
"version": "1.2.29",
"description": "Local and decentralized instances eventbus with web socket addon",
"version": "1.2.31",
"description": "EventBus for local and decentralized instances of the both for individual nodejs applications and as parts of pm2",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -11,3 +11,3 @@ ## 🇺🇦Decentralized instances events

```ecmascript 6
```javascript
process.on('message', async function (packet) {

@@ -27,3 +27,3 @@ /* do something with packet.data */

```ecmascript 6
```javascript
const EventBus = require('node-pm2-events');

@@ -34,3 +34,3 @@ ```

```ecmascript 6
```javascript
// internal events

@@ -46,3 +46,3 @@ EventBus.on('channelName', (m) => {

```ecmascript 6
```javascript
const Config = {

@@ -71,3 +71,3 @@ redis: {

```ecmascript 6
```javascript
// execute on one server and on some other(s)

@@ -89,3 +89,3 @@ await EventBus.transport

* Add [fastify web socket plugin](https://github.com/fastify/fastify-websocket)
```ecmascript 6
```javascript
const fastify = require('fastify')({

@@ -115,3 +115,3 @@ logger: {level: Config.isDev ? 'info' : 'warn'},

> local events will be relayed to your websocket connections and to decentralized servers as well
```ecmascript 6
```javascript
//...

@@ -136,3 +136,3 @@ const routes = [];

[![filterByProcessName](https://img.shields.io/badge/eventbus-websocket_messagesHandler-blue)](https://github.com/rosbitskyy/node-pm2-events/blob/main/main-srv-test.js)
```ecmascript 6
```javascript
// override: handle messages from clients sockets

@@ -168,3 +168,3 @@ EventBus.websocket.messagesHandler = (message, session, connection) => {

```ecmascript 6
```javascript
await EventBus.transport.initialize(Config.redis)

@@ -177,3 +177,3 @@ .filterByProcessName(false)

```ecmascript 6
```javascript
// Somewhere, in the place you need

@@ -195,3 +195,3 @@ EventBus.transport.onMasterChange((isMain) => {

```ecmascript 6
```javascript
await EventBus.transport.initialize(Config.redis)

@@ -221,3 +221,5 @@ .filterByProcessName(false)

desired process.
> EventBus.transport.filterByProcessName(true)
```javascript
EventBus.transport.filterByProcessName(true)
```

@@ -238,3 +240,5 @@ #### PM2 processes list

entity of the microservices ecosystem, turn off filtering by process name:
> EventBus.transport.filterByProcessName(false)
```javascript
EventBus.transport.filterByProcessName(false)
```

@@ -241,0 +245,0 @@ ### Dependencies

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