Registry / messaging / bunqueue

bunqueue

JSON →
library2.8.6jsnpmunverified

Bunqueue is a high-performance job queue for the Bun runtime (≥1.3.9), built specifically for AI agents and automation. Version 2.8.6 provides SQLite persistence, cron scheduling, priorities, retries, dead-letter queues, webhooks, and a native MCP server — all with zero external runtime dependencies (only croner and msgpackr). It is a Redis/BullMQ alternative that ships as ESM-only TypeScript types. The package is actively maintained with frequent releases and benchmarks showing sub-millisecond job processing. Key differentiators: embedded/Simple Mode (queue+worker in one object), optional MCP SDK peer dependency, and a tiny footprint (7 packages, 5.4 MB) unlike Redis-backed alternatives.

messagingdevops
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.

The package is ESM-only; require() will fail. Use the /client path for the Simple Mode combined queue+worker.

import { Bunqueue } from 'bunqueue/client'

The base Queue class is exported from the main package. Queue is distinct from Bunqueue; it's used for distributed systems.

import { Queue } from 'bunqueue'

Worker is a named export from 'bunqueue', not a default export. For distributed setups, use Queue + Worker separately.

import { Worker } from 'bunqueue'

Job is a TypeScript type, not a runtime value. Use 'import type' for correct type-only import.

import type { Job } from 'bunqueue'

Shows how to create a Simple Mode Bunqueue with an embedded worker that processes a job immediately.

import { Bunqueue } from 'bunqueue/client'; const app = new Bunqueue('emails', { embedded: true, processor: async (job) => { console.log(`Sending email to ${job.data.to}`); return { sent: true, id: job.id }; }, }); await app.add('send', { to: 'alice@example.com' }); console.log('Job added and processed by embedded worker');
Debug
Known footguns
breakingRequires Bun >=1.3.9 — does not run on Node.js, Deno, or older Bun versions.
gotchaAll imports must use ESM syntax; 'require()' throws an error because the package ships only ESM with extensionless specifiers.
gotchaWhen using separate Queue and Worker in distributed mode, the Queue must be instantiated before adding jobs to avoid race conditions.
deprecatedThe `Bunqueue` Simple Mode class is the recommended approach; using `Queue` + `Worker` separately is for advanced distributed setups only.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources