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

munro

v0.1.1

Published

p2p live streaming protocol

Readme

munro

a p2p live streaming protocol inspired by ppspp and named after munro. The protocol is completely transport agnostic so it will work wherever you put it.

travis

npm install munro

Usage

First someone must create some data

var munro = require('munro')
var disc = require('discovery-channel')()
var net = require('net')

var mro = munro()
mro.append('hello')
mro.append('world')

var server = net.createServer(function (socket) {
  socket.pipe(mro.peerStream()).pipe(socket)
})

disc.add(mro.id.slice(0, 20), server.address().port)
disc.on('peer', function (hash, peer) {
  var socket = net.connect(peer.port, peer.host)
  socket.pipe(mro.peerStream()).pipe(socket)
})

And then someone will consume it

var munro = require('munro')
var disc = require('discovery-channel')()
var net = require('net')

var mro = munro(id-from-example-above)

var server = net.createServer(function (socket) {
  socket.pipe(mro.peerStream()).pipe(socket)
})

disc.add(mro.id.slice(0, 20), server.address().port)
disc.on('peer', function (hash, peer) {
  var socket = net.connect(peer.port, peer.host)
  socket.pipe(mro.peerStream()).pipe(socket)
})

mro.get(0, function (err, block) {
  console.log(block.toString()) // 'hello'
})

API

var munro = munro(id)

create a new munro instance. If id is specified munro will not be able to broadcast pieces and all pieces recieved will be verified using the id.

var stream = munro.peerStream()

stream is a duplex stream which can be piped to peers in order to replicate data.

munro.broadcast(data)

munro will sign and broadcast the data to connected peers.

munro.get(index, cb)

if connected peers have index munro will attempt to download the data.

munro.destroy()

will destroy all peers and callback error to pending callbacks.

var ws = munro.writeStream()

instead of broadcasting every block. just write it to the stream.

var rs = munro.readStream()

read all the blocks when they become available and pipe them onwards

How does this even work?

Good question. When content is broadcast to the network it is only done so in peers look at the example below.

   1* // munro hash
 /   \
0     2

Two blocks of data are needed to generate a munro hash. Once the hash is generated it is signed off and the peer floods the network with have messages. If a peer is interested in the block it sends back a request message. The broadcaster then sends back the piece and other pieces that are needed to verify the authenticity so in this case it would send back block 2. Once the blocks have been recieved the peer is able to verify the authenticity of the content by calculating the munro hash. If all is well that peer then boadcasts have messages to all of its peers and the process is repeated. This was inspired by ppspp

-piedshag