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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ripe-bus-api

v0.5.0

Published

The Ripe Bus API client

Readme

RIPE Bus API (for Javascript)

The Javascript API for the RIPE event bus.

Should be able to provide an easy-to-use API to be used by microservices of the PERI family.

Initialization

import { API as RipeBusAPI } from "ripe-bus-api-js";

await RipeBusAPI.load();
const bus = new RipeBusAPI();

Usage

Producer

The producer can send one or more events:

bus.trigger("order.created", { id: 1, ... });

bus.trigger("order.created_multiple", [{ id: 1, ... }, { id: 2, ... }]);

The topic defaults to the first part of the name (separated with '.'). The example below defaults to the order topic and the event name is order.created:

bus.trigger("order.created", { id: 1, ... });

The third parameter allows to pass other options to configure event trigger operation. Additional event metadata is added by the API but you can explicitly set it as follows (using options):

bus.trigger("order.created", { id: 1, ... }, {
    topic: "ripe_core.order",
    origin: "ripe-core",
    hostname: "ripe-core.now.platforme.com",
    timestamp: 16007020
});

Consumer

The consumer listens for a topic and executes a callback. The second parameter allows for a callback function or an object containing the callback and other options. The second parameter also allows for callbacks for onSuccess and onError functions if the KafkaRetry consumer is used. It also receives a list of events of interest: any event with a different name is ignored.

bus.bind("order", message => { ... });

bus.bind("order", {
    events: ["order.created", "order.sent", "order.ready"],
    callback: message => { ... }
});

bus.bind("order", {
    events: "order.created",
    callback: message => { ... },
    onSuccess: message => { ... },
    onError: message => { ... },
    retries: 5
});

It is also possible to bind to multiple topics in a single call:

bus.bind(["order", "ripe_twitch:order"], message => { ... });

Configuration

| Name | Type | Default | Description | | ---------------------------------------- | ----- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | | BUS_ADAPTER | str | kafka | The name of the bus adapter adapter to be used (eg: kafka, kafkaRetry). | | KAFKA_HOSTS | str | localhost:9092 | The hostname and port of the Kafka nodes to be used, separated by a , (comma). | | KAFKA_CLIENT_ID | str | ripe-kafka | Kafka client ID, uniquely identifies a connection to a Kafka broker (more here). | | KAFKA_CONSUMER_GROUP_ID | str | ${RANDOM_STRING} | Kafka consumer group ID, identifies a consumer and is unique for a given Kafka broker (more here). | | KAFKA_CONSUMER_RETRY_PERSISTENCE_DIR | str | data | Kafka consumer persistent directory that will store files for message retries. | | KAFKA_RETRIES | int | 5 | Kafka max number of retries to be used in the sending of a message. |

For more details and up-to-date information on Kafka specific configs check the Kafka official documentation.

License

RIPE Bus API (for Javascript) is currently licensed under the Apache License, Version 2.0.

Build Automation

Build Status Build Status GitHub npm Status License