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

@queuebert/bullmq

v0.0.1

Published

BullMQ queue, worker, processor, and stats helpers for Queuebert-aware applications.

Readme

@queuebert/bullmq

BullMQ helpers for Queuebert-aware NestJS applications.

This package provides wrappers and base classes for collecting Queuebert stats from BullMQ queues and workers without putting the integration inside @queuebert/nest.

Installation

npm install @queuebert/bullmq @queuebert/nest @nestjs/bullmq @nestjs/common @nestjs/core bullmq

Exports

  • QueuebertBullMQModule
  • QueuebertBullMQService
  • QueuebertQueue
  • QueuebertWorker
  • BaseQueueProcessor
  • DurationStatsCollector
  • GlobalStatsCollector
  • QueuebertProcessorAdapter
  • Queue, worker, lifecycle, dispatch, and stats types

NestJS Module

Use QueuebertBullMQModule when you want to create Queuebert-wrapped queues and workers from a service.

import { Module } from '@nestjs/common';
import { QueuebertBullMQModule } from '@queuebert/bullmq';

@Module({
  imports: [
    QueuebertBullMQModule.forRoot({
      connection: {
        host: 'localhost',
        port: 6379,
      },
      defaultQueueOptions: {
        defaultJobOptions: {
          attempts: 3,
          removeOnComplete: true,
        },
      },
      statsConfig: {
        windowMs: 60000,
        maxSamples: 1000,
      },
    }),
  ],
})
export class AppModule {}

Async configuration is also supported:

QueuebertBullMQModule.forRootAsync({
  imports: [ConfigModule],
  useFactory: (config: ConfigService) => ({
    connection: {
      host: config.getOrThrow('REDIS_HOST'),
      port: config.getOrThrow('REDIS_PORT'),
    },
  }),
  inject: [ConfigService],
});

BaseQueueProcessor

BaseQueueProcessor extends Nest's WorkerHost and implements the QueuebertProcessor interface from @queuebert/nest. It tracks job duration, success/failure counts, throughput, Redis connection status, and optional cache stats.

import { Processor } from '@nestjs/bullmq';
import { Injectable } from '@nestjs/common';
import { BaseQueueProcessor } from '@queuebert/bullmq';
import type { Job } from 'bullmq';

@Injectable()
@Processor('emails', { concurrency: 10 })
export class EmailProcessor extends BaseQueueProcessor {
  constructor(private readonly emailService: EmailService) {
    super({ queueName: 'emails' });
  }

  async processJob(job: Job<{ to: string; template: string }>) {
    await this.emailService.send(job.data);
    return true;
  }

  protected getCustomStats() {
    return {
      provider: this.emailService.providerName,
    };
  }
}

Register that processor with @queuebert/nest:

import { QueuebertModule } from '@queuebert/nest';

QueuebertModule.forRoot({
  queues: [
    {
      name: 'emails',
      processor: EmailProcessor,
    },
  ],
});

QueuebertBullMQService

Create Queuebert-wrapped queues and workers programmatically:

import { Injectable, OnModuleInit } from '@nestjs/common';
import { QueuebertBullMQService } from '@queuebert/bullmq';

@Injectable()
export class WorkerBootstrap implements OnModuleInit {
  constructor(private readonly queuebertBullMQ: QueuebertBullMQService) {}

  async onModuleInit() {
    const queue = this.queuebertBullMQ.createQueue<{ email: string }>('emails');

    this.queuebertBullMQ.createWorker('emails', async (job) => {
      await sendEmail(job.data.email);
    });

    await queue.add('welcome', {
      email: '[email protected]',
    });
  }
}

Direct Queue and Worker Wrappers

Use QueuebertQueue and QueuebertWorker directly outside NestJS when you want typed dispatch results and local stats collection.

import { QueuebertQueue, QueuebertWorker } from '@queuebert/bullmq';

const queue = new QueuebertQueue<{ email: string }>('emails', {
  connection: {
    host: 'localhost',
    port: 6379,
  },
});

const worker = new QueuebertWorker(
  'emails',
  async (job) => {
    await sendEmail(job.data.email);
  },
  {
    connection: {
      host: 'localhost',
      port: 6379,
    },
  },
);

await queue.add('welcome', {
  email: '[email protected]',
});

console.log(worker.getStats());

Import Path

Import this integration directly from @queuebert/bullmq.

import { BaseQueueProcessor } from '@queuebert/bullmq';

The old nested import shape is not part of the package contract.