npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

udp-call

v0.0.2

Published

Librería UDP potente con ACK, encriptación y broadcast para Node.js

Readme

🚀 udp-call — Librería UDP Potente para Comunicación en Tiempo Real (Node.js) UDP con ACK, encriptación AES y broadcast — Ideal para juegos, chats en tiempo real, streaming y sistemas distribuidos de baja latencia.

License: MIT

Node.js

GitHub Repo

✅ ¿Qué es udp-call? udp-call es una librería de Node.js que implementa una capa UDP robusta con características profesionales:

✅ Confirmación de paquetes (ACK) — Garantiza entrega de mensajes críticos ✅ Reintentos automáticos — Hasta 3 intentos con backoff exponencial ✅ Encriptación AES-256-CBC — Opcional, con clave secreta ✅ Broadcast UDP — Envía a todos en la red local ✅ Eventos embebidos — data, error, ready ✅ Sin dependencias externas — Solo módulos nativos de Node.js Perfecta para:

Chats en tiempo real sin servidor central Juegos multijugador locales Sistemas IoT de bajo consumo Comunicación P2P entre clientes 📦 Instalación bash

1 npm install udp-call ✅ No requiere compilación ni dependencias externas — Solo Node.js ≥12.0.0

💡 Uso Básico 🖥️ Servidor (Reenvía mensajes a todos)

const UDPCall = require('udp-call');

const server = new UDPCall({ port: 3000 }); server.bind();

server.on('ready', () => { console.log('✅ Servidor listo en puerto 3000'); });

server.on('data', (message, rinfo) => { console.log(📩 Recibido de ${rinfo.address}:${rinfo.port} → ${message});

// Reenvía a todos (broadcast) server.broadcast(🔁 Echo: ${message}, 3000); }); 📱 Cliente (Envía y recibe mensajes)

const UDPCall = require('udp-call'); const readline = require('readline');

const client = new UDPCall({ port: 3001 }); client.bind();

client.on('ready', () => { console.log('✅ Cliente listo en puerto 3001'); });

client.on('data', (message, rinfo) => { console.log(💬 Recibido de ${rinfo.address}:${rinfo.port}: ${message}); });

// Entrada de texto en tiempo real const rl = readline.createInterface({ input: process.stdin, output: process.stdout });

rl.on('line', (input) => { if (input.trim()) { client.send(input, 3000, 'localhost'); // Enviar al servidor } }); 🔐 Encriptación (Opcional) Usa una clave secreta para cifrar mensajes:

const client = new UDPCall({ port: 3001, enableEncryption: true, secretKey: 'mi-clave-secreta-32-caracteres-minimo!' // ¡Mínimo 32 chars! });

client.bind(); client.on('data', (message, rinfo) => { console.log(🔒 Mensaje descifrado: ${message}); }); ⚠️ La clave debe tener al menos 32 caracteres. Si es más corta, se rellena con padding (no es seguro). Usa crypto.randomBytes(32).toString('hex') para generar claves seguras.

🌐 Broadcast (Enviar a toda la red) js

1 client.broadcast('¡Hola a todos!', 3000); Usa 255.255.255.255 como destino. Funciona en redes locales (LAN).

🛠️ Métodos Disponibles bind() — Inicia el socket y escucha en port send(data, port, host) string , number , string Envía un mensaje simple sendWithAck(data, port, host, callback) string , number , string , function Envía con confirmación y manejo de errores broadcast(data, port) string , number Envía a toda la red local close() — Cierra el socket

📡 Eventos ready — Socket listo para enviar/recibir data (message: string, rinfo: {address, port}) Mensaje recibido error (err: Error) Error en el socket o al descifrar

const UDPCall = require('udp-call');

const chat = new UDPCall({ port: 3000, enableEncryption: true, secretKey: 'mi-clave-secreta-32-caracteres-minimo!', maxRetries: 5, retryDelay: 200 });

chat.bind();

chat.on('data', (msg, rinfo) => { console.log([${rinfo.address}] ${msg}); });

chat.on('error', (err) => { console.error('❌ Error UDP:', err.message); });

// Enviar con confirmación chat.sendWithAck('¡Hola mundo!', 3000, 'localhost', (err, ack) => { if (err) { console.error('❌ No se pudo entregar el mensaje:', err.message); } else { console.log('✅ Mensaje confirmado:', ack); } }); 📁 Estructura del Proyecto

udp-call/ ├── udp-call.js ← Clase principal ├── index.js ← Exportación principal ├── package.json ← Metadatos ├── README.md ← Este archivo

📌 Notas Importantes ❗ UDP no garantiza entrega — udp-call lo mejora con ACK, pero no es TCP. 🔐 Clave AES: Usa siempre una clave de 32+ caracteres. No uses contraseñas simples. 🌐 Broadcast: Solo funciona en redes locales (no por Internet). 🚫 No soporta IPv6 (por ahora). Usa udp4 exclusivamente. 🧪 No requiere servidor central — Puedes usarlo en modo P2P entre clientes directamente. 🤝 Contribuciones ¡Bienvenidas! Si quieres mejorar la librería:

Haz un fork del repositorio Crea una rama (feature/nueva-funcionalidad) Envía un Pull Request Autores:

@MC_luis_Gamer_YT Salva-Gamer 📄 Licencia MIT © 2025 Salva-Gamer & MC_luis_Gamer_YT

💡 ¿Te gusta esta librería? Dale una ⭐ en GitHub. ¡Ayuda a otros desarrolladores a encontrarla!