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

@babelqueue/rabbitmq

v1.0.0

Published

RabbitMQ adapter for BabelQueue — a canonical-envelope publisher and a URN-routed consumer with the §2 AMQP 0-9-1 property projection (type/correlation_id/message_id + x- headers) over amqplib.

Readme

@babelqueue/rabbitmq

RabbitMQ adapter for BabelQueue — a canonical-envelope publisher and a URN-routed consumer over RabbitMQ (AMQP 0-9-1, amqplib), so a RabbitMQ-based Node service speaks the same wire contract as the PHP, Python, Go, Java and .NET SDKs. Implements §2 of the broker-bindings contract.

The envelope JSON is the message body; the contract fields are projected onto native AMQP 0-9-1 properties so a consumer routes without decoding the body: type = URN, correlation_id = trace_id, message_id = meta.id, app_id = babelqueue, plus the native-typed x-schema-version / x-source-lang / x-attempts headers (AMQP field-tables carry typed values — integers stay integers). Consume is basic.get + manual ack (at-least-once).

Install

npm install @babelqueue/rabbitmq amqplib

amqplib is an optional peer — you provide the channel; an amqplib Channel satisfies the adapter structurally.

Produce

import amqp from "amqplib";
import { RabbitMQPublisher } from "@babelqueue/rabbitmq";

const conn = await amqp.connect("amqp://guest:guest@localhost:5672/");
const channel = await conn.createChannel();
await channel.assertQueue("orders", { durable: true });

const id = await RabbitMQPublisher.create(channel, "orders").publish("urn:babel:orders:created", { order_id: 1042 });

publish(urn, data, { traceId? }) returns the message meta.id. Messages are persistent (delivery_mode = 2).

Consume

import { RabbitMQConsumer, type BabelHandlers } from "@babelqueue/rabbitmq";

const handlers: BabelHandlers = {
  "urn:babel:orders:created": (envelope, message) => {
    // envelope.data, envelope.trace_id, envelope.attempts ...
  },
};

const consumer = new RabbitMQConsumer(channel, "orders", handlers, {
  maxTries: 3,
  onError: (err) => console.error(err),
});

await consumer.run(() => true); // basic.get → process → ack, until you stop it

A successful handler acks the message. A throwing handler republishes the envelope with attempts + 1 (at-least-once) up to maxTries, then dead-letters to <queue>.dlq with a dead_letter block. The consumer routes on properties.type (falling back to the body URN). Unknown-URN strategy is one of fail / delete / release / dead_letter. poll() and handle(message) are exposed for testing.

Contract mapping (§2)

| Envelope | RabbitMQ (AMQP 0-9-1) | | :--- | :--- | | body | message body (the canonical envelope JSON) | | job (URN) | properties.type (consumer routes on this) | | trace_id | properties.correlation_id | | meta.id | properties.message_id | | — | properties.app_id = babelqueue, content_type = application/json, persistent | | meta.schema_version | header x-schema-version (number) | | meta.lang | header x-source-lang | | attempts | header x-attempts (number; the body owns the count) | | reserve / ack | basic.get → process → basic.ack | | retry | republish with attempts + 1 | | dead-letter | <queue>.dlq + dead_letter block |

The envelope is unchanged (schema_version stays 1); the amqplib channel is replaced with a fake in the unit suite — no RabbitMQ, no network.

License

MIT