Registry / devops / bee-queue

bee-queue

JSON →
library2.0.0jsnpmunverified

A simple, fast, robust job/task queue for Node.js, backed by Redis. Current stable version is 2.0.0, requiring Node >= 20 and Redis 2.8+ (3.2+ recommended). Maintained regularly by Mixmax as of v1. Differentiators: ~1000 LOC minimal dependencies, Lua scripting and pipelining for high throughput, designed for short real-time jobs where results are needed within an HTTP request (unlike Bull or Kue which focus on longer background jobs). Supports concurrent processing, job timeouts/retries, scheduled jobs, progress reporting, Pub/Sub events, and at-least-once delivery via stuck job retries.

npm install bee-queue
INSTALL
IMPORT
SIG · BEE-QUEUE
B
bee-queue
devopsjavascriptv2.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.

default
import Queue from 'bee-queue'
const Queue = require('bee-queue').default
ESM import; the default export is the Queue constructor.
Queue
import { Queue } from 'bee-queue'
Named export also available. Use this if you prefer named imports.
default (CommonJS)
const Queue = require('bee-queue')
CJS require; returns the Queue constructor directly.

Demonstrates creating a queue, saving a job, processing it, and receiving the result via event. Uses async/await and callback patterns.

import Queue from 'bee-queue'; const queue = new Queue('example', { redis: { host: process.env.REDIS_HOST ?? '127.0.0.1', port: process.env.REDIS_PORT ? Number(process.env.REDIS_PORT) : 6379 } }); // Create a job const job = queue.createJob({ x: 2, y: 3 }); await job.save(); // Listen for job completion job.on('succeeded', (result) => { console.log(`Received result for job ${job.id}: ${result}`); }); // Process jobs (e.g., in a worker) queue.process(async (job) => { console.log(`Processing job ${job.id}`); return job.data.x + job.data.y; }); // You can also use the old callback style: queue.process(function (job, done) { done(null, job.data.x + job.data.y); });
Debug
Known issues
breakingNode.js >= 20 is required starting from version 2.0.0. Older Node versions are unsupported.
fix
Upgrade Node.js to version 20 or higher.
affects: >=2.0.0
deprecatedThe process callback signature with `done` is deprecated in favor of async/await returning a value.
fix
Use async function: `queue.process(async (job) => { return result; })`.
affects: >=1.0.0
gotchaRedis 3.2+ is recommended; Redis < 3.2 may cause job delays.
fix
Upgrade Redis server to 3.2 or later.
affects: >=0.1.0 <2.0.0
breakingThe `settings` option `pollInterval` has been renamed to `checkInterval` in version 2.0.0.
fix
Use `checkInterval` instead of `pollInterval` in queue settings.
affects: >=2.0.0
gotchaJob `removeOnSuccess` and `removeOnFailure` options are not available in bee-queue; you must manually remove jobs.
fix
Call `job.remove()` after processing if you need to clean up.
affects: *
Errors
Common errors & fixes
TypeError: Queue is not a constructor
Using a named import incorrectly with CommonJS, e.g., `const { Queue } = require('bee-queue')` in a CJS module where the default export is the constructor.
fix
Use `const Queue = require('bee-queue')` for CommonJS.
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis server is not running or not reachable at the configured host/port.
fix
Start Redis server or check your configuration: ensure redis is running and host/port are correct.
Error: job.save() is not a function
Calling `save` on a job object that hasn't been created properly, e.g., `queue.createJob()` without calling `.save()` on the returned object incorrectly.
fix
Use `const job = queue.createJob(data); await job.save();`
Error: queue.process is not a function
Importing an older version or wrong symbol; likely using named export incorrectly in ESM.
fix
Ensure you import the default: `import Queue from 'bee-queue'` then use `new Queue(...).process(...)`.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
redisrequiredRequired for queue backend; bee-queue uses Redis for job storage and coordination.
Agent activity
5 hits · last 30 days
node
4
Resources
bee-queue — npm install bee-queue · libregistry