Registry / storage / theta-mn-queue

theta-mn-queue

JSON →
library3.0.9jsnpmunverified

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.

npm install theta-mn-queue
INSTALL
IMPORT
SIG · THETA-MN-QUEUE
T
theta-mn-queue
storagejavascriptv3.0.9
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.

Queue
import { Queue } from 'theta-mn-queue'
const Queue = require('theta-mn-queue')
ESM-only since v3; no CommonJS support.
Document
import { Document } from 'theta-mn-queue'
import Document from 'theta-mn-queue'
Named export, not default.
QueueProcessor
import { QueueProcessor } from 'theta-mn-queue'
Named export; ensure type imports if using TypeScript.

Shows basic usage: creating a queue, creating a document, enqueuing it, and committing persistence.

import { Queue, Document } from 'theta-mn-queue'; async function main() { const queue = new Queue('my-queue'); await queue.purge(); // clean up any leftover const doc = new Document({ id: await queue.getNextIndex(), key: 'task', content: 'process this', }); await queue.enqueue(doc); await queue.commit(); // persist console.log('Enqueued and committed'); } main().catch(console.error);
Debug
Known issues
gotchaAPI may change without notice; library is in active development.
fix
Pin to exact version and monitor changelog before upgrading.
affects: >=3.0.0
deprecatedCommonJS require() is not supported; ESM only.
fix
Use import statements instead of require().
affects: >=3.0.0
gotchaData source must be configured via environment variables or driver; defaults to file-based storage.
fix
Set THETA_QUEUE_DATA_SOURCE (e.g., 'redis', 'mongo') and corresponding connection details before queue operations.
affects: >=3.0.0
gotchagetNextIndex() is async and must be awaited; otherwise returns a Promise.
fix
Always await queue.getNextIndex() when assigning an id.
affects: >=3.0.0
gotchacommit() must be called after enqueue/dequeue to persist changes; data may be lost otherwise.
fix
Call await queue.commit() after all operations.
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: queue.getNextIndex is not a function
getNextIndex is async and returns a Promise; not awaiting it.
fix
Use: const index = await queue.getNextIndex();
Cannot find module 'theta-mn-queue'
Using CommonJS require() in an ESM-only package.
fix
Use import { Queue } from 'theta-mn-queue' instead of require().
TypeError: queue.commit is not a function
Queue instance not properly initialized or using wrong import.
fix
Ensure you import Queue correctly: import { Queue } from 'theta-mn-queue'.
Upgrade
Version history
3.0.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
theta-mn-queue — npm install theta-mn-queue · libregistry