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

hypermq

v0.0.6

Published

Message-oriented HTTP service inspired by axon and zeromq.

Readme

HyperMQ Build Status

!!! DEPRECIATED !!! SecureMQ has now replaced HyperMQ.

Message-oriented HTTP service inspired by axon and zeromq.

Unlike axon, hypermq uses HTTP for transport rather than plain TCP, this allows hypermq to have:

  • encryption (SSL/TLS).
  • authentication (Basic).
  • firewall friendliness (single port).

If you do not require any of these three features then axon is recommend.

This is not a 'web browser' solution, to do that you could add socket.io on top of hypermq.

Installation

From your terminal, requires node.js.

npm install hypermq

Events

  • closed when peer closes.
  • error (err) when an un-handled socket error occurs.
  • reconnect attempt when a reconnection attempt is made.
  • connected (any url queries sent as object) when connected to the peer, or a peer connection is accepted.
  • queued (msg) when a message is enqueued, can use to save unsent messages.
  • flushed (total messages) queued when messages are flushed on connection.
  • message (msg) the message received by peer.

Patterns

  • push / pull
  • pub / sub
  • chit / chat

Examples

See examples folder. To print debugging info use the --preview argument when running the app, for example:

node examples/pushpull/push.js --preview

Push / Pull Example

pushs distribute messages round-robin:

var hypermq = require('hypermq');

var options = {
  hostname: '127.0.0.1',
  port: 3443,
  secure: true,
  key: __dirname + '/key.pem',
  cert: __dirname + '/cert.pem',
  apikey: 'za91j2bk72f483ap62x' 
};
var service = hypermq.bind(options);

var myService = new service('myService', 'push');
console.log('myService:push server started');

setInterval(function(){
  myService.send('hello');
}, 100);

Receiver of push messages:

var hypermq = require('hypermq');

var options = { 
  hostname: '127.0.0.1', 
  port: 3443, 
  secure: true, 
  rejectUnauthorized: false,
  apikey: 'za91j2bk72f483ap62x' 
};
var service = hypermq.connect(options);

var myService = new service('myService', 'pull');

myService.on('message', function(msg){
  console.log(msg.toString());
});

Chit / Chat Example

chits is bi-directional, broadcast to all chat peers and can receive messages back:

var hypermq = require('hypermq');

var options = {
  hostname: '127.0.0.1',
  port: 3443,
  secure: true,
  key: __dirname + '/key.pem',
  cert: __dirname + '/cert.pem',
  apikey: 'za91j2bk72f483ap62x' 
};
var service = hypermq.bind(options);

var myService = new service('myService', 'chit');
console.log('myService:chit server started');

myService.on('message', function(msg){
  console.log(msg.toString());
});

setInterval(function(){
  myService.send('hello chat');
}, 100);

chats is bi-directional, can receive and send messages to chit:

var hypermq = require('hypermq');

var options = { 
  hostname: '127.0.0.1', 
  port: 3443, 
  secure: true, 
  rejectUnauthorized: false,
  apikey: 'za91j2bk72f483ap62x' 
};
var service = hypermq.connect(options);

var myService = new service('myService', 'chat');

myService.on('message', function(msg){
  console.log(msg.toString());
});

setInterval(function(){
  myService.send('hello chit');
}, 1000);

Message Protocol

hypermq has two message protocols for you to choose from; AMP protocol, with node-amp-message, the second protocol available is Line Delimited JSON.

hypermq uses AMP by default as it is fastest and most flexible. AMP allows you to apply any message codec, such as: json, msgpack, or to use javascript/node.js objects: buffer (binary), strings. Line Delimited JSON is useful for connecting peers written in different languages.

Example sending javascript/node.js mixed object with the AMP protocol.

myService.send( {hello: 'world', x: 101, fab: true, image: new Buffer('binary image data')} );

Set message protocol options amp, ldjson:

{
  protocol: 'amp'   // (default), or: 'ldjson' for Line Deineated JSON.
}

Performance

You can benchmark hypermq. With secure set to true will be slower as messages are encrypted.

Benchmark without batching:

make bench

Benchmark with batching:

make benchbatch

Results

Sending a 200 byte sized batched unsecure message, on my laptop (dual-core i7), I get around 183,546 messages per second:

  [2208 ops/s] [10001]

      min: 2,208 ops/s
     mean: 2,211 ops/s
   median: 2,230 ops/s
    total: 11,057 ops in 5s
  through: 0.42 mb/s

------------------------------
   events: 917,731
       id: 23,388
     mean: 183,546 ops/s.
------------------------------

License

Choose either: MIT or Apache 2.0.