Registry / database / monq
library0.3.7jsnpmunverified

monq is a MongoDB-backed job queue for Node.js that provides a simple interface for enqueuing and processing jobs. Version 0.3.7 is the latest stable release, though the project appears to be in maintenance mode with no recent updates. It differs from alternatives like Bull or Kue by its minimal dependency on MongoDB and straightforward API, but lacks advanced features like scheduling, retries with backoff, or priority queues.

npm install monq
INSTALL
IMPORT
SIG · MONQ
M
monq
databasejavascriptv0.3.7
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 monq from 'monq'
const monq = require('monq')
ESM import is not officially supported; package uses CommonJS. For TypeScript, use default import or require.
Client
import { Client } from 'monq'
const { Client } = require('monq')
The main export is a function, not a named export. Named exports may not be available.
Queue
const { Queue } = require('monq')
import { Queue } from 'monq'
Queue is not exported directly; use client.queue() instead.
Worker
const { Worker } = require('monq')
import { Worker } from 'monq'
Worker is not exported directly; use client.worker() instead.

Connects to MongoDB, enqueues a 'reverse' job, and processes it with a worker.

const monq = require('monq'); const client = monq('mongodb://localhost:27017/monq_example'); const queue = client.queue('example'); queue.enqueue('reverse', { text: 'foobar' }, (err, job) => { if (err) console.error(err); else console.log('enqueued:', job.data); }); const worker = client.worker(['example']); worker.register({ reverse: (params, callback) => { try { const reversed = params.text.split('').reverse().join(''); callback(null, reversed); } catch (err) { callback(err); } } }); worker.start();
Debug
Known issues
deprecatedPackage has not been updated since 2016 and may have unpatched security vulnerabilities.
fix
Consider migrating to a maintained alternative like Bull or Agenda.
affects: >=0.3.0
gotchaDefault export is a function that returns a client; incorrect imports can lead to undefined errors.
fix
Use `const monq = require('monq'); const client = monq(uri);`
affects: <=0.3.7
gotchaWorker must be started with `worker.start()` after registering functions, otherwise jobs will not be processed.
fix
Always call `worker.start()` after registration.
affects: <=0.3.7
breakingThe MongoDB driver version used may be incompatible with newer MongoDB server versions.
fix
Upgrade to a newer job queue or manually update the mongodb dependency.
affects: <=0.3.7
Errors
Common errors & fixes
TypeError: monq is not a function
Incorrect import; using named import instead of default.
fix
Use `const monq = require('monq');` or `import monq from 'monq';` if using ESM.
Error: Cannot find module 'mongodb'
Missing mongodb dependency. monq requires mongodb as a peer or transitive dependency.
fix
Run `npm install mongodb` in your project.
MongoError: Authentication failed
MongoDB URI missing credentials or incorrect.
fix
Provide valid credentials in the URI, e.g., `mongodb://user:pass@localhost:27017/db`.
Upgrade
Version history
0.3.7latest on npm
Audit
Dependencies
mongodbrequiredMongoDB driver required for database operations
Agent activity
6 hits · last 30 days
node
6
Resources
packagemonq
monq — npm install monq · libregistry