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

asynczap

v2.0.0

Published

A lightweight, MongoDB-backed job queue for Node.js

Readme

AsyncZap ⚡

🚀 Why AsyncZap?

Most job queues require Redis as a separate dependency. AsyncZap eliminates that overhead by using MongoDB's advanced capabilities to provide a complete, distributed queueing system. It offers:

  • Distributed & Horizontally Scalable: Automatic partitioning spreads jobs across collections to eliminate locking bottlenecks.
  • DAG Workflow Engine: Build complex job dependencies and pipelines effortlessly.
  • Atomic Backpressure: Prevent downstream service overload with cluster-wide concurrency limits.
  • Multi-Tenant Fairness: Isolate customer queues and guarantee fair scheduling in SaaS products.
  • Built-in Observability: Native Prometheus metrics, CLI tooling, and an embedded zero-dependency dashboard.

📦 Quick Start

Installation

npm install asynczap

Note: mongoose is required as a peer dependency. @nestjs/common is an optional peer dependency (only needed if using AsyncZapModule).

Basic Usage

import mongoose from 'mongoose';
import { AsyncZapQueue } from 'asynczap';

async function bootstrap() {
  await mongoose.connect('mongodb://localhost/myapp');
  
  // 1. Initialize the Queue with 4 partitions
  const queue = new AsyncZapQueue(mongoose.connection, { partitions: 4 });
  await queue.initialize();

  // 2. Enqueue a Job
  const job = await queue.add('send-email', { to: '[email protected]' });
  console.log(`Job enqueued: ${job._id}`);

  // 3. Start a Worker Worker
  const worker = queue.createWorker({ partitions: [0, 1, 2, 3] });
  worker.process('send-email', async (job) => {
    console.log(`Sending email to ${job.payload.to}`);
  });
  
  await worker.start();
}
bootstrap();

✨ Feature Highlights

| Feature | Description | | ------- | ----------- | | 🛡️ Idempotency | Prevent duplicate jobs with unique idempotency keys. | | 🔁 Retries & DLQ | Automatic exponential backoff retries and Dead Letter Queue. | | ⏱️ Job Scheduling | Schedule jobs to execute securely in the future. | | 🏎️ Turbo Mode | High-throughput batch prefetching capabilities. | | 📈 Prometheus Integration | Exposed endpoint returning industry-standard metrics. | | 🔌 NestJS Module | Optional @nestjs/common integration (AsyncZapModule). |

📐 Architecture Overview

AsyncZap uses Deterministic Hashing to distribute jobs across multiple MongoDB collections (asynczap_jobs_0, asynczap_jobs_1, etc.). Workers independently poll assigned partitions, achieving zero cross-worker lock contention.

Read more in our Architecture Guide.

🚀 Performance & Benchmarks

Compared directly to Single-Collection queues, AsyncZap's bulk enqueuing is highly optimized. Tested against Atlas M0 Cloud Database:

  • Bulk Enqueue: ~871 jobs/second (174x faster than sequential)
  • Scaling: Linearly scales by setting n partitions and w workers.

Read the Full Benchmark Results.

⚔️ Comparison

| Feature | BullMQ | Agenda | AsyncZap | |---------|--------|--------|-------------| | Backing Store | Redis | MongoDB | MongoDB | | Partitioning | ❌ | ❌ | ✅ N-way | | DAG Workflows | ❌ | ❌ | ✅ Built-in | | Multi-Tenancy | ❌ | ❌ | ✅ Fair scheduling | | Backpressure | Manual | ❌ | ✅ Atomic counters | | Prometheus | External | ❌ | ✅ Native |

📚 Documentation

Dive deeper into our specific comprehensive guides:

🖥️ CLI & Dashboard

AsyncZap comes with an embedded dashboard and a CLI.

npx asynczap dashboard -u mongodb://localhost/myapp -p 3000

Optionally secure the API with a bearer token:

npx asynczap dashboard -u mongodb://localhost/myapp -p 3000 --token my-secret

Then visit http://localhost:3000.

To view stats in terminal:

npx asynczap stats -u mongodb://localhost/myapp

🤝 Contributing

We welcome contributions! Please review our Contributing Guide and Code of Conduct before opening a PR.

📜 License

This project is licensed under the MIT License.