npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@udthedeveloper/mqox

v1.2.0

Published

Message Queuing & Background Job Processing System

Downloads

9

Readme

NPM Stats

MQOx is a lightweight, flexible message queuing system powered by Redis. It supports delayed jobs, retries, priority-based job scheduling, worker processing, and features a Dead Letter Queue (DLQ) for robust fault tolerance.


Update: Priority Queue (High → Low execution order) & Web Dashboard is now available to monitor queues, priority queues, DLQs


Supported Models

| Model | QoS Level | Persistence | Delivery Guarantee | Ideal For | | ---------------- | --------- | ----------- | --------------------------- | ---------------------------------------- | | Queue | QoS 1 | ✅ Yes | Guaranteed (with DLQ) | Background jobs, task runners | | Queue (Priority) | QoS 1 | ✅ Yes | Guaranteed (priority order) | Task scheduling, notifications, SLA jobs | | Pub/Sub | QoS 0 | ❌ No | Best effort (fire & forget) | Real-time notifications | | Pub/Sub | QoS 1 | ✅ Yes | At-Least-Once Delivery | Financial transactions, critical events |

Overview

A message queue is a system that lets applications handle tasks asynchronously - meaning jobs are added to a queue and processed later by background workers instead of immediately. This keeps your app fast, scalable, and fault-tolerant.

MQOx uses Redis to manage these queues efficiently. It lets you:

  • Enqueue jobs
  • Process them using workers
  • Automatically move failed jobs to a Dead Letter Queue (DLQ)

MQOx helps you build reliable background job systems for tasks like sending emails, generating reports, or handling any heavy processing all without blocking your main application.



Features

| Feature | Description | | --------------------- | ------------------------------------------------- | | Job Enqueuing | Push jobs with optional delays and retry settings | | Worker Consumption | Workers continuously listen and process jobs | | Retry Mechanism | Automatically retries failed jobs | | Dead Letter Queue | Moves permanently failed jobs to a DLQ | | Scalable Architecture | Multiple workers can consume from the same queue |


Usage

Dashboard

~/Desktop/MQOx$ mqox-dashboard

MQOx Dashboard is starting...
Connected to Redis at redis://localhost:6379
MQOx Dashboard: http://localhost:3000

Queue Example

const { Queue, Employee } = require("@udthedeveloper/mqox");

const queue = new Queue("emailQueue");
const worker = new Employee("emailQueue");

worker.work(async (job) => {
  console.log("Processing job:", job);
});

Priority Queue

Producer

const { Queue } = require("@udthedeveloper/mqox");

async function main() {
  const queue = new Queue({ queueName: "emailQueue", priority: true });
  await queue.connect();

  await queue.enqueue(
    "sendEmail",
    { to: "[email protected]" },
    { priorityLevel: 1 }
  );
  await queue.enqueue(
    "sendEmail",
    { to: "[email protected]" },
    { priorityLevel: 3 }
  );
  await queue.enqueue(
    "sendEmail",
    { to: "[email protected]" },
    { priorityLevel: 5 }
  );

  console.log("✅ Emails enqueued by priority");
}

main();

Employee

const { Employee } = require("@udthedeveloper/mqox");

async function main() {
  const worker = new Employee("emailQueue", { priority: true });
  await worker.work(async (job) => {
    console.log(`📩 Sending email to ${job.payload.to}`);
    await new Promise((r) => setTimeout(r, 1000));
    console.log(`✅ Email sent to ${job.payload.to}`);
  });
}

main();

Pub/Sub QoS 0

const { PubSub0 } = require("@udthedeveloper/mqox");

const pubsub = new PubSub0("notifications");

pubsub.subscribe((msg) => console.log("Received:", msg));
pubsub.publish({ text: "Hello world!" });

Pub/Sub QoS 1

const { PubSub1 } = require("@udthedeveloper/mqox");

const pubsub = new PubSub1("order-stream", "order-group", "worker-1");

async function main() {
  await pubsub.connect();

  await pubsub.publish({ orderId: 101, status: "CREATED" });

  pubsub.subscribe(async (message) => {
    console.log("Received QoS1 message:", message);
  });
}

main();

📁 Project Structure

MQOx
│
├── src
│ ├── demo
│ │ ├── demoJobEmployee.ts # Worker demo
│ │ └── demoJobProducer.ts # Queue demo producer
│ │
│ ├── pubsub
│ │ ├── qos-0.ts # Pub/Sub QoS 0
│ │ └── qos-1.ts # Pub/Sub QoS 1
│ │
│ ├── types
│ │ ├── employee.type.ts
│ │ ├── enqueue.type.ts
│ │ └── job.type.ts
│ │
│ ├── employee.ts
│ ├── queue.ts
│ ├── redisClient.ts
│ └── index.ts
│
├── public/assets
│ ├── example.jpeg
│ ├── Flow.jpg
│ └── logo.jpeg
│
├── .env
├── package.json
├── tsconfig.json
└── README.md

Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/udaykumar-dhokia/MQOx.git
cd MQOx

2️⃣ Install Dependencies

npm install

3️⃣ Setup Environment Variables

Create a .env file in the project root:

REDIS_URL=redis://localhost:6379

Make sure Redis is running locally or update the URL accordingly.

4️⃣ Build the Project

npm run build

Running the Demo

Step 1: Start the Worker

This will start listening for jobs and processing them.

npm run demo:employee

Step 2: Run the Producer to Add Jobs

In a new terminal:

npm run demo:producer

Expected Output

  • Jobs will be added to the queue.
  • Worker consumes them.
  • If a job fails and retry attempts are exhausted, it's moved to the Dead Letter Queue.

How MQOx Works (Flow)

┌────────────────┐
│  Producer      │
│ (enqueue job)  │
└───────┬────────┘
        ▼
┌───────────────────────┐
│ Redis Queue (FIFO)    │
└───────┬───────────────┘
        ▼
┌───────────────────────┐
│ Employee (Worker)     │
│ Processes the Job     │
└───────┬───────┬───────┘
        │Success│Failure
        │       ▼
        │   RetryCount > 0?
        │         │
        │         ├─ YES → Requeue
        │         └─ NO → Dead Letter Queue
        ▼
┌───────────────────────┐
│Dead Letter Queue (DLQ)│
└───────────────────────┘

Commands Overview

| Command | Description | | ----------------------- | -------------------- | | npm install | Install dependencies | | npm run build | Compile TypeScript | | npm run demo:employee | Run worker demo | | npm run demo:producer | Run producer demo |

You can define these scripts in your package.json like:

"scripts": {
  "build": "tsc",
  "start": "node dist/index.js",
  "demo:employee": "ts-node src/demo/demoJobEmployee.ts",
  "demo:producer": "ts-node src/demo/demoJobProducer.ts"
}

🙌 Contribution

Pull requests and feature suggestions are welcome!

⭐ If this project is useful to you, please give it a star to show your support!