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

@ovcina/rapidriver

v2.0.8

Published

A Rapid-River architecture using RabbitMQ

Downloads

83

Readme

ovcina-rapidriver 2.0.8

RabbitMQ is required to be running: https://www.rabbitmq.com/download.html

Installation

Create a folder for the microservice. Open a terminal window and navigate to the empty folder.

Install rapidriver Node module:

npm install @ovcina/rapidriver

Creating the service

An example can be found in service-example.js

First import the node module:

var rapidriver = require("@ovcina/rapidriver");

Define a constant called 'host':

const host = 'amqp://localhost';

Subscribe to an event on a river:

rapidriver.subscribe(host, [
    {river: "test", event: "display", work: (msg) => {
        console.log(" [*] Received: '%s'", msg); 
    }}
]);

Send an event back to the rapid, and remember to add the "publish" parameter in the callback function:

rapidriver.subscribe(host, [
    {river: "test", event: "display", work: (msg, publish) => {
        publish("error", "Error Message"); 
    }}
]);

Testing the service

Run RabbitMQ message broker:

rabbitmq-server

Run the service:

node service.js

The file "producer.js" is for sending a message to the rapid which the service can subscribe to. It's only used for testing the service:

node path/to/producer.js <event_name> <message>

Open a new terminal window. To test the running service-example.js, run the producer and make a display event:

node node_modules/@ovcina/rapidriver/producer.js "display" "hello world"

It is also possible to publish a message programmatically, without having to subscribe to a river first:

rapidriver.publish(host, event, msg);

Further Testing

Try making a new service (in a different folder), and make it subscribe to the "error" river.

rapidriver.subscribe(host, [
    {river: "monitoring", event: "error", work: (msg) => {
        console.log(" [*] Received: '%s'", msg); 
    }}
]);

In the first service add the "publish(event, msg)" line which sends an error event back into the river. Now when both services are run, make the producer send a display event, the first service will send an error event which the other service will subscribe to and print out.