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

msqe

v1.0.3

Published

MSQE (Message Queue Events) – A lightweight, real-time message queue and pub/sub system built with WebSocket and Node.js.

Downloads

20

Readme

MSQE – Message Queue Events

MSQE (Message Queue Events) is a lightweight, real-time WebSocket-based message queue and pub/sub system for Node.js and TypeScript.
It supports multi-topic publishing, replay, subscriber acknowledgment, and secure admin API.

Developed by: Sayyed Mohammad Adil


Table of Contents

  1. Features
  2. Installation
  3. Quick Start
  4. Settings
  5. Publisher
  6. Subscriber
  7. Admin API
  8. Examples

Features

| Feature | Description | |---------|-------------| | Multi-topic Publish | Publish messages to multiple topics simultaneously | | Subscriber Acknowledgment | Reliable message delivery with ack & retry | | Replay Messages | Request replay of past messages from timestamp | | Admin API | Monitor status and replay messages securely | | JWT Auth | Secure Admin API with user authentication | | Logging | Logs all events, retries, and ack failures | | TypeScript Support | Fully typed and modular |


Installation

Install MSQE from NPM


npm install msqe

Or using yarn



yarn add msqe

Quick Start Settings


import { Settings } from "msqe";

Settings.configure({
  topicRetention: {
    orderCreated: 7*24*60*60*1000,
    paymentReceived: 7*24*60*60*1000,
    shipmentDispatched: 7*24*60*60*1000
  },
  retryLimit: 5,
  ackTimeout: 5000,
  logDir: "./logs",
  authUsers: { admin: "1234" },
  jwtSecret: "your-secret-key"
});

CommonJS version:


const { Settings } = require("msqe");

Settings.configure({
  topicRetention: {
    orderCreated: 7*24*60*60*1000,
    paymentReceived: 7*24*60*60*1000,
    shipmentDispatched: 7*24*60*60*1000
  },
  retryLimit: 5,
  ackTimeout: 5000,
  logDir: "./logs",
  authUsers: { admin: "1234" },
  jwtSecret: "your-secret-key"
});

Publisher


import { Publisher } from "msqe";

const pub = new Publisher({ port: 9090 });
pub.publish("orderCreated", { orderId: 101, customer: "Alice" });

// Get status
console.log(pub.getStatus());

CommonJS version:


const { Publisher } = require("msqe");

const pub = new Publisher({ port: 9090 });
pub.publish("orderCreated", { orderId: 101, customer: "Alice" });
console.log(pub.getStatus());

Subscriber


import { Subscriber } from "msqe";

const sub1 = new Subscriber({ url: "ws://localhost:9090", events: ["orderCreated"] });
sub1.on("orderCreated", data => console.log("[Sub1] Order Created:", data));

// Request replay of last 1 hour
sub1.requestReplay({ fromTimestamp: Date.now() - 1000*60*60 });

CommonJS version:


const { Subscriber } = require("msqe");

const sub1 = new Subscriber({ url: "ws://localhost:9090", events: ["orderCreated"] });
sub1.on("orderCreated", data => console.log("[Sub1] Order Created:", data));
sub1.requestReplay({ fromTimestamp: Date.now() - 1000*60*60 });

Admin API


import { startAdminApiServer } from "msqe";

// Starts admin API server on port 8081
startAdminApiServer(pub, 8081);

Endpoints:

GET /status – Returns current publisher status

GET /replay – Replay messages with optional filters: topic, from, ack

Authentication: Use authUsers + jwtSecret for secure access.

Full Example


import { Settings, Publisher, Subscriber, startAdminApiServer } from "msqe";

Settings.configure({
  topicRetention: {
    orderCreated: 7*24*60*60*1000,
    paymentReceived: 7*24*60*60*1000,
    shipmentDispatched: 7*24*60*60*1000
  },
  retryLimit: 5,
  ackTimeout: 5000,
  logDir: "./logs",
  authUsers: { admin: "1234" },
  jwtSecret: "your-secret-key"
});

const pub = new Publisher({ port: 9090 });
startAdminApiServer(pub, 8081);

const sub1 = new Subscriber({ url: "ws://localhost:9090", events: ["orderCreated", "paymentReceived"] });
sub1.on("orderCreated", data => console.log("[Sub1] Order Created:", data));
sub1.on("paymentReceived", data => console.log("[Sub1] Payment Received:", data));

const sub2 = new Subscriber({ url: "ws://localhost:9090", events: ["orderCreated", "shipmentDispatched"] });
sub2.on("orderCreated", data => console.log("[Sub2] Order Created:", data));
sub2.on("shipmentDispatched", data => console.log("[Sub2] Shipment Dispatched:", data));

setTimeout(() => {
  pub.publish("orderCreated", { orderId: 101, customer: "Alice" });
  pub.publish("paymentReceived", { orderId: 101, amount: 250 });
  pub.publish("shipmentDispatched", { orderId: 101, carrier: "DHL" });
}, 1000);

setTimeout(() => {
  sub1.requestReplay({ fromTimestamp: Date.now() - 1000*60*60 });
  sub2.requestReplay({ fromTimestamp: Date.now() - 1000*60*60 });
}, 2000);

CommonJS version:


const { Settings, Publisher, Subscriber, startAdminApiServer } = require("msqe");

Settings.configure({
  topicRetention: {
    orderCreated: 7*24*60*60*1000,
    paymentReceived: 7*24*60*60*1000,
    shipmentDispatched: 7*24*60*60*1000
  },
  retryLimit: 5,
  ackTimeout: 5000,
  logDir: "./logs",
  authUsers: { admin: "1234" },
  jwtSecret: "your-secret-key"
});

const pub = new Publisher({ port: 9090 });
startAdminApiServer(pub, 8081);

const sub1 = new Subscriber({ url: "ws://localhost:9090", events: ["orderCreated", "paymentReceived"] });
sub1.on("orderCreated", data => console.log("[Sub1] Order Created:", data));
sub1.on("paymentReceived", data => console.log("[Sub1] Payment Received:", data));

const sub2 = new Subscriber({ url: "ws://localhost:9090", events: ["orderCreated", "shipmentDispatched"] });
sub2.on("orderCreated", data => console.log("[Sub2] Order Created:", data));
sub2.on("shipmentDispatched", data => console.log("[Sub2] Shipment Dispatched:", data));

setTimeout(() => {
  pub.publish("orderCreated", { orderId: 101, customer: "Alice" });
  pub.publish("paymentReceived", { orderId: 101, amount: 250 });
  pub.publish("shipmentDispatched", { orderId: 101, carrier: "DHL" });
}, 1000);

setTimeout(() => {
  sub1.requestReplay({ fromTimestamp: Date.now() - 1000*60*60 });
  sub2.requestReplay({ fromTimestamp: Date.now() - 1000*60*60 });
}, 2000);

Contributing Developed by Sayyed Mohammad Adil. Feel free to submit issues or pull requests on GitHub.