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

egg-bullboard-plugin

v3.1.2

Published

eggjs bullboard adapter plugin for bullmq

Readme

egg-bullboard-plugin

NPM version Test coverage Known Vulnerabilities npm download

Install

npm i egg-bullboard-plugin

Note: The latest version 3.x is primarily intended for Egg.js v3. Support for Egg.js v4 has been introduced in the 1.x release, but it is not yet fully tested.

Prerequisites

This plugin depends on the following EggJS plugins:

  • static plugin (built-in): Required to serve BullBoard static assets
  • view plugin (built-in): Required to resolve BullBoard UI file render engine
  • ejs plugin: Required to render the BullBoard UI, as it is written in EJS

Make sure these plugins are enabled in your application's plugin configuration.

Usage

Enable bullboard plugin

// {app_root}/config/plugin.js
export default {
  bullboard: {
    enable: true,
    package: 'egg-bullboard-plugin',
  },
};
// {app_root}/config/config.default.js
export default {
  bullboard: {
    client: {
      basePath: '',
      boardOptions: {},
    },
  },
};
  • basePath: the base path to view bullboard, eg: https://localhost:7001/{basePath}
  • boardOptions: the createBullBoard options from @bull-board/api

see src/config/config.default.ts for more detail.

Configure view plugin

This maps .ejs file to the render engine of ejs, which by this case registered by egg-view-ejs.

// {app_root}/config/plugin.js
export default {
  view: {
    mapping: {
      '.ejs': 'ejs',
    },
  },
};

Configure ejs plugin

Recommend ejs rendering plugin but could be replaced, any capable one could do, as long as the ext mapping is correct. So regarding this the required egg-view-ejs dependency is removed for flexibility, BUT DON'T FORGET TO ENABLE ONE!!!

// {app_root}/config/plugin.js
export default {
  ejs: {
    enable: true,
    package: 'egg-view-ejs',
  },
};

Static plugin

Static plugin is enabled by default; this bullboard plugin will tweak its configuration to serve bullboard UI assets.

Example

After the plugin is loaded, the BullBoard client instance is mounted to the app. You can access it via app.bullboard to get the BullBoardClient, and use its API to manage BullMQ queues.

Adding Queues To Display Board

You could use app.bullboard api to add queue to display. Here's an example:

// {app_root}/app.js
import { Queue } from 'bullmq';

export default class AppBootHook {
  constructor(app) {
    this.app = app;
  }

  async didLoad() {
    // Access the BullBoard client instance
    const bullboard = this.app.bullboard;

    // Create your BullMQ queue instances
    const emailQueue = new Queue('email', {
      connection: {
        host: 'localhost',
        port: 6379,
      },
    });

    const notificationQueue = new Queue('notification', {
      connection: {
        host: 'localhost',
        port: 6379,
      },
    });
    // Add queues to BullBoard
    bullboard.addQueue(emailQueue);
    bullboard.instance.addQueue(notificationQueue);
  }
}

The app.board is an instance of BullBoardClient, on which the instance attr is an instance of createBullBoard; For more details about the createBullBoard API and available methods, please refer to the @bull-board/api documentation.

Interface

BullBoardClientOptions

Configuration options for a BullBoard client instance.

interface BullBoardClientOptions {
  /**
   * The base path where BullBoard UI will be accessible.
   * For example, if basePath is '/admin/queues', the BullBoard will be available at https://localhost:7001/admin/queues
   */
  basePath: string;

  /**
   * Options passed to createBullBoard from @bull-board/api.
   * See @bull-board/api documentation for available options.
   * @see https://github.com/felixmosh/bull-board
   */
  boardOptions: BoardOptions;
}

BullBoardClient

Provides a convenience wrapper for BullMQAdapter instantiation over the BullBoard Client API.

Note: Do not mix this encapsulated API with the original BullBoard Client API. For example, adding a BullMQ queue via this.instance.addQueue and removing it with this.removeQueue will fail silently, as the class instance has no track of those directly added queue instances.

interface BullBoardClient {
  instance: ReturnType<typeof createBullBoard>;
  setQueues(queues: Queue[]): void;
  replaceQueues(queues: Queue[]): void;
  addQueue: (queue: Queue) => void;
  removeQueue: (queueOrName: string | Queue) => void;
}

BullBoardConfig

Main configuration interface for the bullboard plugin.

interface BullBoardConfig {
  /**
   * Default bullboard instance option.
   * Used when no specific client name is provided.
   */
  default?: BullBoardClientOptions;

  /**
   * Singleton case option declaration.
   * Use this when you only need one BullBoard instance.
   */
  client?: BullBoardClientOptions;

  /**
   * Multiple instances case option declaration.
   * Use this when you need multiple named BullBoard instances.
   * Keys are client names, values are BullBoardClientOptions.
   */
  clients?: {
    [clientName: string]: BullBoardClientOptions;
  };
}

Questions & Suggestions

Please open an issue here.

License

MIT

Contributors

Contributors

Made with contributors-img.