Registry / storage / embedded-queue

embedded-queue

JSON →
library0.0.11jsnpmunverified

embedded-queue is a job/message queue for Node.js and Electron that persists data using NeDb embedded database, eliminating the need for external processes like Redis or MySQL. Current stable version is 0.0.11 with low release cadence. Key differentiators are zero external dependencies for persistence (NeDb is embedded), and a simple API for creating jobs, processors, and event handlers.

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

CommonJS: destructure Queue from the package. Version <=1 supported this pattern.

const { Queue } = require('embedded-queue');

ESM: named import. Note: the package does not provide default export.

import { Queue } from 'embedded-queue';

Event is a named export containing constants like Complete, Failure, etc.

const { Event } = require('embedded-queue');

TypeScript type import for Job interface, e.g., import type { Job } from 'embedded-queue';

import { Job } from 'embedded-queue';

Shows basic queue creation, job processing, event handling, job creation, and shutdown.

const { Queue, Event } = require('embedded-queue'); (async () => { const queue = await Queue.createQueue({ inMemoryOnly: true }); queue.process('adder', async (job) => job.data.a + job.data.b, 1); queue.on(Event.Complete, (job, result) => { console.log(`Job ${job.id} completed with result ${result}`); }); await queue.createJob({ type: 'adder', data: { a: 1, b: 2 } }); setTimeout(async () => { await queue.shutdown(1000); }, 100); })();
Debug
Known footguns
gotchaQueue.createQueue only accepts NeDb options object, not a callback; missing await causes initialization race.
deprecatedThe default export EmbeddedQueue is deprecated; use named exports { Queue, Event }.
gotchaJob processor must return a Promise; returning a plain value may cause undefined behavior.
gotchaQueue events like Complete receive (job, result) but Failure receives (job, error); mixing them up leads to runtime errors.
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
16 hits · last 30 days
gptbot
3
amazonbot
3
bytedance
3
Resources