Registry / messaging / coney
library2.0.0jsnpmunverified

Coney is a simple queue library backed by RabbitMQ, designed for Node.js applications that require reliable message queuing with minimal configuration. Version 2.0.0 is the latest stable release, with no active release cadence documented. It supports basic queue operations (push, pop), retry with delay, and pub/sub patterns. Compared to full-featured RabbitMQ client libraries like amqplib, Coney provides a higher-level abstraction focused on simplicity. It ships with TypeScript types and requires amqplib as a peer dependency (^1.0.0). The library is MIT-licensed and maintained on GitHub.

npm install coney
INSTALL
IMPORT
SIG · CONEY
C
coney
messagingjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Coney
import { Coney } from 'coney'
const Coney = require('coney')
ESM only; the package does not export a default. Named export must be used.
Queue
import { Queue } from 'coney'
import { Queue } from 'coney/queue'
Queue is a named export from the main entry. No subpath import exists.
Exchange
import { Exchange } from 'coney'
import * as coney from 'coney'; const Exchange = coney.Exchange
Namespace import is unnecessary; named import is preferred with ESM.

Shows how to instantiate Coney with an amqplib channel, create a queue, push and pop messages, and subscribe to a queue.

import { Coney } from 'coney'; import amqplib from 'amqplib'; async function main() { const connection = await amqplib.connect(process.env.RABBITMQ_URL || 'amqp://localhost'); const channel = await connection.createChannel(); const coney = new Coney(channel); const queue = coney.queue('my-queue'); // Push a message await queue.push({ hello: 'world' }); // Pop a message const msg = await queue.pop(); console.log(msg); // Subscribe to a queue const sub = coney.sub('my-queue', (msg) => { console.log('Received:', msg); }); // Unsubscribe later sub.unsubscribe(); await connection.close(); } main().catch(console.error);
Debug
Known issues
breakingConey v2 removed the 'connect' method; you must pass an amqplib channel directly.
fix
Use the constructor with a channel: new Coney(channel)
affects: >=2.0.0
deprecatedThe 'qos' option in queue creation is deprecated and will be removed in v3.
fix
Do not use qos; configure prefetch on the channel directly via amqplib.
affects: >=2.0.0
gotchaConey does not automatically reconnect; if the connection drops, you must recreate the channel and instantiate a new Coney.
fix
Implement reconnection logic in your application using amqplib's connection error events.
affects: >=2.0.0
gotchaAll Coney methods are asynchronous and return Promises; forgetting to await may cause silent failures.
fix
Ensure you await calls to push, pop, subscribe, etc.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Channel is closed
Attempting to use a Coney instance after the underlying amqplib channel has been closed.
fix
Create a new channel and a new Coney instance.
TypeError: coney.queue is not a function
Using an older version (v1) where the method was 'createQueue' or different import path.
fix
Upgrade to v2 and use 'coney.queue()' as shown in the docs.
MODULE_NOT_FOUND: amqplib
Missing peer dependency amqplib.
fix
Run 'npm install amqplib' or 'yarn add amqplib'.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
amqplibrequiredPeer dependency for RabbitMQ connection and channel management
Agent activity
39 hits · last 30 days
node
36
Amazon
1
OpenAI (training)
1
Resources
packageconey
coney — npm install coney · libregistry