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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rm-ws

v0.3.1

Published

RM WS

Readme

SocketIO + Redis - RM WebSocket

Este paquete creado para Node JS sirve para utilizar websocket con Socket IO.

Example

const init_rmws = require('rm-ws'); // Include Package
const express = require('express'); // Include Express Framework

const app = express();

init_rmws(); // Init RM WebSocket
const { Router, Middleware, Server, Sender } = global.socket_actions; // Obteins Controllers

// Set middlewares
function middleware_example(socket, next) {
    // Set Client ID
    socket.uuid = "exampleOfId";
    socket.uuid2 = "exampleOfId2";
    console.log("New Client Connected");
    next();
}

Middleware(middleware_example); // Set a middleware

function controller_example(socket, args, arg2) {
    console.log('fn controller', socket.io ,args, arg2);

    socket.join('home');

    socket.emit('hello', "Mensaje recibido", socket.io);
}

function controller_example_by_route(socket) {
    console.log('path /home', socket.uuid);
    console.log('route', socket.handshake)

    socket.join('home');

    socket.emit('hello', "Mensaje recibido de /home", socket.uuid);
}

setTimeout(() => {
    setInterval(() => {
        let msg1 = new Sender('room_msg', "este es un mensaje grupal");
        msg1.send_to_rooms(["home"]);
        console.log('interval')

        let msg2 = new Sender('room_msg', "Mensaje solo par el usuario id ramiromacciuci");
        
        // If we need change ID default (uuid) for uuid2 use 
        msg2.set_special_id('uuid2')

        msg2.send_by_client_id(["exampleOfId"]);
    }, 1000);
}, 2000);

Router('ruta1', controller_example); // Seteamos una ruta

Router(['/home', 'home'], controller_example_by_route); // Seteamos ruta con namespace

const server = new Server({
    socket_settings: {
        path: "/ws", // Main Path
        perMessageDeflate: false,
        allowEIO3: true, // Permitimos la version 3 de socketio
        cors: {
            methods: ["GET", "POST"], // Habilitamos CORS
            origin: 'http://localhost:3000', // WHITE LIST
            allowedHeaders: ["my_custom_header"], // Headers permitidos
            credentials: true, // Recibimos credenciales
        }
    },
    app_server: app,
    port: 8080,
    redis_settings: {
        host: 'localhost',
        port: 6379
    }
})

server.init();

Sobre el autor

Ramiro Macciuci Ciudad de Buenos Aires, Argentina.