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

brokr

v0.6.1

Published

Websocket RPC+PUB/SUB library

Readme

Brokr

brokr is a javascript RPC+PUB/SUB via Websocket library that you shouldn't use.

Usage

In the browser

If you need to use Brokr in the browser, you can

  • Use the included connect middleware Brokr.middleware(url) to serve a browser friendly Brokr version.
  • Use the Brokr.browserify(callback) function to get the source as a string.
  • Use the included build tool. Simply run make build in the Brokr module root to build the brokr.web.js file.

Brokr spec.

very much work in progress

brokr
    v : version     1.0
    t : type        hey, req, res, pub, sub, unsub, pserr,
    p : package     data. Format depends on type field

Meta

"Hey" package

{
    "brokr": {
        "v": "1.0",
        "t": "hey",
        "p": {
        }
    }
}

RPC

####request package containing 2 requests

{
    "brokr": {
        "v": "1.0",
        "t": "req",
        "p": {
            "abcd1": {
                "fn": "ping",
                "args": []
            },
            "abcd2": {
                "fn": "time",
                "args": []
            },
        }
    }
}

####response package containing 2 responses

{
    "brokr": {
        "v": "1.0",
        "t": "res",
        "p": {
            "abcd2": [null, "pong"],        //[error, data]
            "abcd1": [null, 1370981044.033] //[error, data]
        }
    }
}

PubSub

  • Topics must be created on the fly.
  • There is no queue

####subscribe package

{
    "brokr": {
        "v": "1.0",
        "t": "sub",
        "p": {
            "abcd1": {
                "topic": "notifications"
            },
            "abcd2": {
                "topic": "new-topic"
            }
        }
    }
}

####subscribe OK/err

Response to each subscription request. null means no error.

Errors codes are: (WIP)

010   That is already the case   

100   Generic client error
101   Not a subscriber

200   Generic server error
{
    "brokr": {
        "v": "1.0",
        "t": "pserr",
        "p": {
            "abcd1": null,
            "abcd2": null
        }
    }
}

####unsubscribe package

{
    "brokr": {
        "v": "1.0",
        "t": "unsub",
        "p": {
            "abcd3": {
                "topic": "notifications"
            },
            "abcd4": {
                "topic": "new-topic"
            }
        }
    }
}

and the response

{
    "brokr": {
        "v": "1.0",
        "t": "pserr",
        "p": {
            "abcd3": null,
            "abcd4": null
        }
    }
}

####publish package

Request that server publishes messages on topics

There is no response to this request

{
    "brokr": {
        "v": "1.0",
        "t": "pub",
        "p": {
            "notifications": [{"hello": "world"}]
        }
    }
}