{"id":49508,"library":"theta-mn-queue","title":"Theta MN Queue","description":"Theta MN Queue is a TypeScript-based queue system that supports multiple data sources (files, Redis, MongoDB via Mongoose) for persistence. Version 3.0.9 is the latest stable release, but the library is in active development and the API may change. It provides Queue and Document classes for enqueue/dequeue operations with commit-based persistence. Compared to alternatives like Bull or Bee Queue, it offers simpler setup with multi-source support but lacks advanced features like rate limiting or delayed jobs. The package ships TypeScript types and is ESM-only.","status":"active","version":"3.0.9","language":"javascript","source_language":"en","source_url":"https://github.com/mustafaneguib/theta-mn-queue","tags":["javascript","queue","typescript queue","file queue","redis queue","mongo queue","mongoose queue","mongodb queue","typescript"],"install":[{"cmd":"npm install theta-mn-queue","lang":"bash","label":"npm"},{"cmd":"yarn add theta-mn-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add theta-mn-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v3; no CommonJS support.","wrong":"const Queue = require('theta-mn-queue')","symbol":"Queue","correct":"import { Queue } from 'theta-mn-queue'"},{"note":"Named export, not default.","wrong":"import Document from 'theta-mn-queue'","symbol":"Document","correct":"import { Document } from 'theta-mn-queue'"},{"note":"Named export; ensure type imports if using TypeScript.","wrong":"","symbol":"QueueProcessor","correct":"import { QueueProcessor } from 'theta-mn-queue'"}],"quickstart":{"code":"import { Queue, Document } from 'theta-mn-queue';\n\nasync function main() {\n  const queue = new Queue('my-queue');\n  await queue.purge(); // clean up any leftover\n  const doc = new Document({\n    id: await queue.getNextIndex(),\n    key: 'task',\n    content: 'process this',\n  });\n  await queue.enqueue(doc);\n  await queue.commit(); // persist\n  console.log('Enqueued and committed');\n}\nmain().catch(console.error);","lang":"typescript","description":"Shows basic usage: creating a queue, creating a document, enqueuing it, and committing persistence."},"warnings":[{"fix":"Pin to exact version and monitor changelog before upgrading.","message":"API may change without notice; library is in active development.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use import statements instead of require().","message":"CommonJS require() is not supported; ESM only.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Set THETA_QUEUE_DATA_SOURCE (e.g., 'redis', 'mongo') and corresponding connection details before queue operations.","message":"Data source must be configured via environment variables or driver; defaults to file-based storage.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Always await queue.getNextIndex() when assigning an id.","message":"getNextIndex() is async and must be awaited; otherwise returns a Promise.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Call await queue.commit() after all operations.","message":"commit() must be called after enqueue/dequeue to persist changes; data may be lost otherwise.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'3.0.9':27 'activ':38 'advanc':78 'altern':61 'api':42 'base':11,57 'bee':65 'bull':63 'chang':44 'class':50 'commit':56 'commit-bas':55 'compar':59 'data':17 'delay':84 'develop':39 'document':49 'enqueue/dequeue':52 'esm':94 'esm-on':93 'featur':79 'file':19,100 'javascript':96 'job':85 'lack':77 'latest':30 'librari':35 'like':62,80 'limit':82 'may':43 'mn':2,5 'mongo':104 'mongodb':21,108 'mongoos':23,106 'multi':73 'multi-sourc':72 'multipl':16 'offer':68 'oper':53 'packag':87 'persist':25,58 'provid':46 'queue':3,6,12,47,66,97,99,101,103,105,107,109 'rate':81 'redi':20,102 'releas':32 'setup':70 'ship':88 'simpler':69 'sourc':18,74 'stabl':31 'support':15,75 'system':13 'theta':1,4 'type':90 'typescript':10,89,98,110 'typescript-bas':9 'version':26 'via':22","created_at":"2026-06-07T17:02:07.831965+00:00","updated_at":"2026-06-07T17:02:07.831965+00:00","problems":[{"fix":"Use: const index = await queue.getNextIndex();","cause":"getNextIndex is async and returns a Promise; not awaiting it.","error":"TypeError: queue.getNextIndex is not a function"},{"fix":"Use import { Queue } from 'theta-mn-queue' instead of require().","cause":"Using CommonJS require() in an ESM-only package.","error":"Cannot find module 'theta-mn-queue'"},{"fix":"Ensure you import Queue correctly: import { Queue } from 'theta-mn-queue'.","cause":"Queue instance not properly initialized or using wrong import.","error":"TypeError: queue.commit is not a function"}],"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/mustafaneguib/theta-mn-queue#readme","github":"https://github.com/mustafaneguib/theta-mn-queue","docs":null,"changelog":null,"pypi":null,"npm":"theta-mn-queue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage","devops"],"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}}