{"id":44779,"library":"docmq","title":"DocMQ","description":"A document-based messaging queue for MongoDB (v4.7+), PostgreSQL (v8.7+), and other databases via a custom driver interface. Current stable version is 0.5.7. Released as an alternative to BullMQ and Agenda, DocMQ prioritizes database abstraction, timezone-aware scheduling, and in-memory development mode over raw performance. It supports concurrency, job repetition, scheduling, persistence, and queue-level hooks. Suitable when persistence and scheduling across timezones are critical, but not for high-throughput FIFO scenarios. Releases are infrequent; the package ships TypeScript types and is ESM-only.","status":"active","version":"0.5.7","language":"javascript","source_language":"en","source_url":"https://github.com/jakobo/docmq","tags":["javascript","typescript"],"install":[{"cmd":"npm install docmq","lang":"bash","label":"npm"},{"cmd":"yarn add docmq","lang":"bash","label":"yarn"},{"cmd":"pnpm add docmq","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required driver for MongoDB backend (optional if not used)","package":"mongodb","optional":true},{"reason":"Required driver for PostgreSQL backend (optional if not used)","package":"pg","optional":true}],"imports":[{"note":"DocMQ is ESM-only; CJS require will fail.","wrong":"const DocMQ = require('docmq')","symbol":"DocMQ","correct":"import { DocMQ } from 'docmq'"},{"note":"Named export for MongoDB backend driver.","wrong":"","symbol":"MongoDriver","correct":"import { MongoDriver } from 'docmq'"},{"note":"Named export for PostgreSQL backend driver.","wrong":"","symbol":"PostgresDriver","correct":"import { PostgresDriver } from 'docmq'"},{"note":"Default export does not exist; must use named import.","wrong":"import InMemoryDriver from 'docmq'","symbol":"InMemoryDriver","correct":"import { InMemoryDriver } from 'docmq'"}],"quickstart":{"code":"import { DocMQ, InMemoryDriver } from 'docmq';\n\nasync function main() {\n  const docMq = new DocMQ({ driver: new InMemoryDriver() });\n  await docMq.start();\n\n  // Define a job handler\n  await docMq.handle('email', async (job) => {\n    console.log(`Sending email to ${job.data.to}`);\n    return { sent: true };\n  });\n\n  // Schedule a job\n  const job = await docMq.schedule('email', { to: 'user@example.com' }, { delay: '5m' });\n  console.log('Job scheduled:', job.id);\n\n  // Wait for completion\n  const result = await job.result();\n  console.log('Job result:', result);\n\n  await docMq.stop();\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Initializes a DocMQ instance with in-memory driver, registers a handler, schedules a delayed job, and waits for the result."},"warnings":[{"fix":"Ensure your project is configured for ESM (type: 'module' in package.json) or use dynamic import() if necessary.","message":"ESM-only package: DocMQ uses ES modules and cannot be required with CommonJS. Must use import syntax.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Install mongodb@^4.7.0 as a dependency.","message":"MongoDB driver v4+ required: DocMQ relies on mongodb@^4.7.0. Do not use older versions.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Install pg@^8.7.3 as a dependency.","message":"PostgreSQL driver v8+ required: DocMQ relies on pg@^8.7.3. Do not use older versions.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Switch to MongoDriver or PostgresDriver for production.","message":"In-memory driver data is lost on restart: The InMemoryDriver does not persist jobs; use only for development/testing.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Use import { DocMQ } from 'docmq'.","message":"No default export: Attempting import DocMQ from 'docmq' will fail; must use named import.","severity":"gotcha","affected_versions":">=0.5.0"}],"env_vars":null,"search_vec":"'0.5.7':25 'abstract':37 'across':68 'agenda':33 'altern':29 'awar':40 'base':5 'bullmq':31 'concurr':53 'critic':71 'current':21 'custom':18 'databas':15,36 'develop':46 'docmq':1,34 'document':4 'document-bas':3 'driver':19 'esm':91 'esm-on':90 'fifo':78 'high':76 'high-throughput':75 'hook':62 'in-memori':43 'infrequ':82 'interfac':20 'javascript':93 'job':54 'level':61 'memori':45 'messag':6 'mode':47 'mongodb':9 'packag':84 'perform':50 'persist':57,65 'postgresql':11 'priorit':35 'queue':7,60 'queue-level':59 'raw':49 'releas':26,80 'repetit':55 'scenario':79 'schedul':41,56,67 'ship':85 'stabl':22 'suitabl':63 'support':52 'throughput':77 'timezon':39,69 'timezone-awar':38 'type':87 'typescript':86,94 'v4.7':10 'v8.7':12 'version':23 'via':16","created_at":"2026-06-07T12:51:47.933173+00:00","updated_at":"2026-06-07T12:51:47.933173+00:00","problems":[{"fix":"Use import syntax or switch to ESM mode in your project.","cause":"DocMQ is ESM-only and cannot be loaded with require()","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Use import { DocMQ } from 'docmq' instead of import DocMQ from 'docmq'.","cause":"Attempted to use default import instead of named import","error":"TypeError: docMq is not a constructor"},{"fix":"Install mongodb@^4.7.0.","cause":"Using an incompatible version of mongodb driver","error":"MongoParseError: options appName, ... are not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jakobo/docmq#readme","github":"https://github.com/jakobo/docmq","docs":null,"changelog":null,"pypi":null,"npm":"docmq","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}