Registry / devops / mini-queue

mini-queue

JSON →
library0.0.14jsnpmunverified

mini-queue v0.0.14 is a lightweight in-memory job queue for Node.js (engine >=4). It provides a state machine for job lifecycle (new, queue, dequeue, process, complete, reject, cancel) with journaling of state transitions and timestamps. It supports grouping jobs by group and name, and limits journal length. The package is minimal with no external dependencies, suitable for simple queuing needs without persistence or distributed workers. Last updated in 2017-2018, it is in maintenance mode.

devops
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 library is CommonJS but can be imported with ESM in Node >= 12 using default import transpilation.

import MiniQueue from 'mini-queue';

The module exports a single constructor function as module.exports, not a named export.

const MiniQueue = require('mini-queue');

QueueJob is a property on the exported constructor; it is not exported as a named export in ESM.

const QueueJob = require('mini-queue').QueueJob;

Creates a MiniQueue instance with concurrency 2, creates a job with auto-start, and another manually queued job.

const MiniQueue = require('mini-queue'); const queue = new MiniQueue({ concurrency: 2, maxJournalLength: 10 }); queue.on('error', (err) => console.error(err)); queue.createJob({ group: 'mygroup', name: 'myname', process: (job, done) => { console.log('Processing job', job.id); done(null, 'result'); }, start: true }); // Or manually: const job = queue.createJob({ process: (job, done) => { console.log('Manual job', job.id); setTimeout(() => done(null, 'done'), 100); } }); queue.queueJob(job.id); queue.on('complete', (job) => { console.log('Job completed:', job.id, job.result); console.log('Journal entry:', job.journalEntry); console.log('Full journal:', JSON.stringify(queue.journal, null, 2)); });
Debug
Known footguns
gotchaprocess function must call done() or job will hang forever.
gotchaJob IDs are numeric and auto-incremented globally across all queues.
deprecatedThe package has not been updated since 2018; use at your own risk for production.
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