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

ws-events-and-middlewares

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ws-events-and-middlewares - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

21

index.js
const Emitter = require('component-emitter')
const uuidv4 = require('uuid/v4')

@@ -160,2 +161,6 @@ callbackCounter = 0

function clients () {
return clients
}
var events = Object.create(sock)

@@ -172,7 +177,19 @@ events.emit = emit

events.toAll = toAll
events.clients = clients
// Guardamos el nuevo cliente
clients[sock.id] = events
// Generamos un id para el socket solo si estamos en el servidor y guardamos el socket como cliente, en el cliente no es necesario
if (typeof module !== 'undefined' && module.exports) {
let found = false
while (!found) {
const id = uuidv4()
if (!clients[id]) {
found = true
events.id = id
clients[id] = events
}
}
}
return events
}

5

package.json
{
"name": "ws-events-and-middlewares",
"version": "1.0.15",
"version": "1.0.16",
"description": "ws module wrapper to provide events",

@@ -27,4 +27,5 @@ "main": "index.js",

"dependencies": {
"component-emitter": "^1.2.1"
"component-emitter": "^1.2.1",
"uuid": "^3.3.2"
}
}
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