Registry / messaging / nestjs-power-queues

nestjs-power-queues

JSON →
library1.0.34jsnpmunverified

High-performance Redis Streams queue integration for NestJS, wrapping the power-queues library. Current stable version is 1.0.34. It uses environment variables for Redis configuration and provides a QueueService with hooks like onBatchReady and onBatchError. Key differentiators vs Bull/BullMQ: built specifically for NestJS with @InjectQueue decorator, supports multiple Redis clients, and allows extending QueueService directly. Release cadence is irregular as a small side project. Ships TypeScript types and requires Node >=14.

npm install nestjs-power-queues
INSTALL
IMPORT
SIG · NESTJS-POWER-QUEUE
N
nestjs-power-queues
messagingjavascriptv1.0.34
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QueueModule
import { QueueModule } from 'nestjs-power-queues';
const QueueModule = require('nestjs-power-queues').QueueModule;
ESM-only; CommonJS require may work but is not recommended. QueueModule is a NestJS module.
InjectQueue
import { InjectQueue } from 'nestjs-power-queues';
import { InjectRedis } from 'nestjs-power-queues';
Use @InjectQueue('queues') to inject a QueueService; InjectRedis is from nestjs-power-redis.
QueueService
import { QueueService, Task } from 'nestjs-power-queues';
import { QueueService } from 'power-queues';
QueueService is from nestjs-power-queues; do not import from power-queues directly.

Registers QueueModule with a Redis client named 'queues' and injects the queue service to add tasks.

import { Module } from '@nestjs/common'; import { QueueModule } from 'nestjs-power-queues'; import { MyService } from './my.service'; @Module({ imports: [ QueueModule.forRoot(['queues']), ], providers: [MyService], }) export class AppModule {} // my.service.ts import { Injectable } from '@nestjs/common'; import { InjectQueue, QueueService, Task } from 'nestjs-power-queues'; @Injectable() export class MyService { constructor( @InjectQueue('queues') private readonly queueService: QueueService, ) {} async test() { const payload = [{ id: 1, name: 'test' }]; await this.queueService.addTasks('example:job', payload); } }
Debug
Known issues
gotchaEnv variable prefix is REDIS_QUEUES_, not REDIS_; missing any required env var may cause silent connection failure.
fix
Ensure .env contains REDIS_QUEUES_HOST, REDIS_QUEUES_PORT, etc.
affects: >=1.0.0
deprecatedUsing require() may not work as the package is ESM-first; some CommonJS bundlers may fail.
fix
Use import syntax or configure your bundler for ESM.
affects: >=1.0.0
gotchaQueueService must be extended; directly instantiating it without extending may cause unexpected behavior.
fix
Create a class that extends QueueService and implements queueName() and onBatchReady().
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'nestjs-power-redis'
Missing peer dependency nestjs-power-redis.
fix
npm install nestjs-power-redis
ENV variable REDIS_QUEUES_HOST not set or empty
Missing .env file or environment variables for Redis connection.
fix
Set REDIS_QUEUES_HOST, REDIS_QUEUES_PORT, REDIS_QUEUES_DATABASE, and optional REDIS_QUEUES_PASSWORD in .env or environment.
Upgrade
Version history
1.0.34latest on npm
Audit
Dependencies
nestjs-power-redisrequiredRequired for Redis client injection (@InjectRedis) used in worker examples
power-queuesrequiredCore queue implementation; may be a peer dependency
full-utilsoptionalUsed in examples for isArrFilled and isObjFilled; likely a dev dependency but included in README
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
nestjs-power-queues — npm install nestjs-power-queues · libregistry