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

elysia-irismq2

v0.2.0

Published

[Github](https://github.com/tuplescompany/elysia-irismq)

Readme

elysia-irismq - BullMQ Plugin for Elysia queues

Github

A small plugin for the Elysia framework that provides a Redis backed job queue using BullMQ.

The plugin exposes a decorator for declaring events, utilities for queuing them and an Elysia plugin that starts a worker.

Installation

bun install elysia-irismq

Peer dependencies elysia, bullmq, ioredis and typescript must also be available in your project.

Defining a new event

Create a class that extends Event and decorate it with @IsEvent() and define how to handle it:

import { IsEvent, Event } from 'elysia-irismq';

@IsEvent()
class WelcomeEvent extends Event<{ clientId: string }> {
	// default options

	// void
	async handle() {
		await EmailService.sendWelcome(this.payload.clientId);
	}
}

@IsEvent()
class SendEmail extends Event<{ to: string }> {
	/**
	 * How many times the job will be retried on failure.
	 * @optional @default 5
	 */
	public override retries: number = 5;
	/**
	 * Delay in milliseconds before retrying a failed job.
	 * @optional @default 15000
	 */
	public override delayOnFailure: number = 15000;
	/**
	 * If true, removes the job when it successfully completes When given a number,
	 * it specifies the maximum amount of jobs to keep, or you can provide an object specifying max age and/or count to keep.
	 * @optional @default true (delete job after complete)
	 */
	public override removeOnComplete: boolean | number = true;
	/**
	 * If true, removes the job when it fails after all attempts. When given a number,
	 * it specifies the maximum amount of jobs to keep, or you can provide an object specifying max age and/or count to keep.
	 * @optional @default 100 (keep 100 failed attempts in redis)
	 */
	public override removeOnFail: boolean | number = 100;

	async handle() {
		console.log(`Email to ${this.getPayload().to}`);
	}
}

Using the plugin with Elysia

import Elysia from 'elysia';
import { queuePlugin } from 'elysia-irismq';

const app = new Elysia().use(queuePlugin(options /* optional */)).listen(3000);

The plugin will start a BullMQ worker using the provided Redis connection (default host=localhost, port=6379, no user, no password). It also decorates the Elysia context with a dispatch function so you can enqueue jobs inside route handlers.

See src/example for a complete usage example.

Options avaiable

// Options
type IrisOpts = {
	/** Redis HOST @default '127.0.0.1' */
	host: string;
	/** Redis PORT @default 6379 */
	port: number;
	/** Redis USERNAME @default undefined */
	user?: string;
	/** Redis PASSWORD @default undefined */
	pass?: string;
	/**
	 * If true, only log errors
	 * If false, logs when a job is queued or completed
	 * @default false
	 */
	silent: boolean;
	/**
	 * Amount of jobs that a single worker is allowed to work on in parallel.
	 * @default 10
	 */
	concurrency: number;
};

Queueing an event within handlers

import Elysia from 'elysia';

const app = new Elysia()
	.use(queuePlugin()) // default host=127.0.0.1 port=6379 no username or password
	.get(
		'/',
		// dispatch an Event from request Context
		({ query: { to }, dispatch /* decorated context */ }) => {
			// the Event is dispatched in the background; does not block request handling
			dispatch(new SendEmail({ to: '[email protected]' }));
			return 'ok';
		},
	)
	.listen(3000);

Queueing an event outside handlers

import { dispatch } from 'elysia-irismq';

dispatch(new SendEmail({ to: '[email protected]' }));

Development

bun test

This project uses Bun's test runner and TypeScript.

⚠️ Design Scope & Limitations

This plugin is designed for a single Redis-backed job queue, where each job can represent a self-defined events types. While it supports multiple event types, all jobs are pushed into the same queue, which makes it a good fit for simple use cases such as:

  • Single-purpose background workers
  • medium-scale job processing pipelines
  • Microservice-only scope

Can scale horizontal thanks too BullMQ, but for large-scale pipelines other solutions are better.