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

primus-concierge

v0.0.1

Published

room manager for primus clusters

Readme

primus-concierge

A room management system meant to work with a redis-backed primus cluster.

installation

npm install --save primus-concierge

usage

const primus = require('primus');
const primus_concierge = require('primus-concierge');

const wss = primus.createServer({
    port: 8000,
    redis: {
        host: 'localhost',
        port: 6379
    }
});

wss.plugin('concierge', primus_concierge);

wss.on('connection', (spark) => {
    spark.on('data', (data) => {
        switch(data.action) {
                case 'join-room':
                    spark.join(data.body.room);
                    break;
                case 'broadcast':
                    spark.broadcast(data.body.room, data.body.message);
                    break;
                case 'leave-room':
                    spark.leave(data.body.room);
                    break;
                case 'say':
                    spark.say(data.body.to, data.body.message);
                    break;
        }
    });
});

api

Concierge adapts the spark that is available after a connection has been established.

spark-api

spark._rooms: Array

Spark._rooms is an array object that contains a set of rooms that the current spark belongs to. Because it is entirely in-memory, if a user "disconnects" for any reason, they are removed from all the rooms they belong to

spark.join(room_name: string)

By calling this method, you will join the current spark to the room specified. If the room does not exist, it is created. The current membership of the room is tracked in redis

spark.leave(room_name: string)

This method will cause the spark to leave the specified room

spark.broadcast(room_name: string, msg: any)

This will send the message provided to all sockets within a room, except for the sender.

spark.say(id: string, msg: any)

This will allow you to message any spark that this server has access to and send them the msg provided. This method relies on having omega-supreme installed and loaded for message support across a primus cluster. If you are not using omega-supreme, just don't use this particular message and you'll be fine

spark.roommates(room_name: string, cb: function(err: Error, roommates: Array))

Return a list of people in the room specified. If you are looking up a room that you are a part of, please note that it will also return your socket id

todo

[ ] Add support for room events

license

MIT