Registry / messaging / loke-queue

loke-queue

JSON →
library1.4.0jsnpmunverified

Simple RabbitMQ wrapper for Node.js exposing queue functionality with connection management, routing key subscription, and configurable concurrency and retry. The current stable version is 1.4.0, with low release cadence. It provides a high-level abstraction over the amqplib library, supporting promises and automatic reconnection. Differentiators include a simple API for subscribing with routing patterns and built-in concurrency control, though it lacks modern ESM exports and TypeScript definitions.

npm install loke-queue
INSTALL
IMPORT
SIG · LOKE-QUEUE
L
loke-queue
messagingjavascriptv1.4.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.

Connection
var Connection = require('loke-queue').Connection
const { Connection } = require('loke-queue')
The package uses CommonJS; destructuring require works but var/const is fine.
default import
var lokeQueue = require('loke-queue')
import lokeQueue from 'loke-queue'
No default export; only named exports via CommonJS.
Connection (ESM)
import { Connection } from 'loke-queue';
const { Connection } = require('loke-queue');
ESM import is supported, but the package does not provide TypeScript types.

Connects to RabbitMQ, creates a queue with concurrency limit, subscribes to a routing pattern, publishes a message, and stops after a timeout.

var Connection = require('loke-queue').Connection; var connection = new Connection('amqp://guest:guest@localhost:5672'); var queue = connection.queue('jobs', {maxConcurrent: 20}); queue.subscribe('demo.*', function (message) { console.log(message); return new Promise(function (resolve) { setTimeout(resolve, 500); }); }); setTimeout(function (){ queue.stop(); }); connection.publish('demo.test', { message: 'Hello World' });
Debug
Known issues
deprecatedThe package is no longer actively maintained; consider using amqplib directly or a more modern alternative.
fix
Switch to amqplib or a maintained wrapper.
affects: all
gotchaRequires RabbitMQ to be running; connection will throw if not available.
fix
Ensure RabbitMQ is running before creating a Connection.
affects: all
gotchaThe 'stop' method on a queue does not stop the connection; you must also close the connection.
fix
Call connection.close() or connection.end() to fully clean up.
affects: all
Errors
Common errors & fixes
Error: Channel closed by server: 404 (NOT-FOUND) with message "NOT_FOUND - no queue '...'"
The queue does not exist on RabbitMQ; the library does not auto-create it.
fix
Create the queue manually in RabbitMQ or ensure 'assert' option is set.
Error: connect ECONNREFUSED 127.0.0.1:5672
RabbitMQ is not running or connection URL is wrong.
fix
Start RabbitMQ or verify the AMQP URL.
TypeError: queue.subscribe is not a function
Calling subscribe on something that is not a queue object.
fix
Ensure you obtained the queue via connection.queue() and not connection.publish().
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
amqplibrequiredRabbitMQ client library
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
loke-queue — npm install loke-queue · libregistry