Registry / devops / node-simple-queue

node-simple-queue

JSON →
library1.0.4jsnpmunverified

A MongoDB-backed job queue for Node.js with a Resque-like API. Version 1.0.4 (latest) provides basic enqueue/dequeue operations, job classes with a perform method, and a CLI worker. Requires MongoDB for storage and is intended for simple background job processing in Node.js. Release cadence is sparse; the package has not been updated recently. Its key differentiator is simplicity, but it lacks advanced features like retries, scheduling, or priority queues.

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.

Named export, not default. CommonJS require works but ESM import is correct.

import { NodeQueue } from 'node-simple-queue'

Both patterns work, but destructuring is cleaner.

const { NodeQueue } = require('node-simple-queue')

Job classes require a static perform method. Can be defined as a class or constructor function.

class MyJob { static perform(data, done) { ... } }

Demonstrates importing NodeQueue, defining a global job class, enqueueing a job, and starting a worker from CLI.

const { NodeQueue } = require('node-simple-queue'); const queue = new NodeQueue(); // Define a job class (must be global for worker to find) class MyJob { static perform(data, done) { console.log('Processing:', data); done(null, true); } } global.MyJob = MyJob; // Enqueue a job queue.enqueueJob('myqueue', 'MyJob', { message: 'Hello' }); // Start worker via CLI: // node node_modules/node-simple-queue/bin/node-worker start QUEUE=myqueue WORKERS=2 console.log('Job enqueued!');
Debug
Known footguns
gotchaJob class must be defined globally (as a property of global object) for the worker to find it.
deprecatedPackage uses MongoDB directly but does not list it as a dependency; you must install mongodb separately.
breakingWorker CLI expects the binary at node_modules/node-simple-queue/bin/node-worker; global install may break path.
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
9 hits · last 30 days
gptbot
3
ahrefsbot
1
Resources