Registry / messaging / node-queue-processor

node-queue-processor

JSON →
library1.0.9jsnpmunverified

A Node.js queue processing application supporting AWS SQS and Google Pub/Sub with rate limiting. Version 1.0.9 is the latest and only stable release with no active development. It allows attaching workers to handle messages from multiple queue backends, includes built-in rate limiting backed by Redis, and requires manual configuration of queue instances. Differentiators include a simple worker-manager pattern and support for both SQS and Pub/Sub.

npm install node-queue-processor
INSTALL
IMPORT
SIG · NODE-QUEUE-PROCESS
N
node-queue-processor
messagingjavascriptv1.0.9
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.

Manager
const { Manager } = require('node-queue-processor');
const Manager = require('node-queue-processor').Manager;
CommonJS only. No ESM support.
Worker
const { Worker } = require('node-queue-processor');
const Worker = require('node-queue-processor/Worker');
Named export, not a subpath export.
RateLimit
const { RateLimit } = require('node-queue-processor');
const RateLimit = require('node-queue-processor').RateLimit;
Part of the main module exports.

Sets up a queue processor with AWS SQS, a rate-limited worker, and starts processing messages.

const { Manager, Worker, RateLimit } = require('node-queue-processor'); const AwsSqsQueue = require('node-queue-processor/lib/AwsSqsQueue'); const queue = new AwsSqsQueue({ access_key: process.env.AWS_ACCESS_KEY ?? '', secret_access_key: process.env.AWS_SECRET_KEY ?? '' }, process.env.SQS_QUEUE_URL ?? ''); const worker = new Worker(async (data) => { console.log('Processing:', data); return 'done'; }, new RateLimit({ process_per_period: 5, period: 60 }, { id: 'my-worker', redisConnection: { host: process.env.REDIS_HOST ?? '127.0.0.1', port: parseInt(process.env.REDIS_PORT ?? '6379', 10) } })); const manager = new Manager(queue); manager.attachWorker('sample-handler', worker); manager.start(); console.log('Queue processor started...');
Debug
Known issues
breakingQueue classes are not exported from the main entry point; must be required from specific paths.
fix
Use require('node-queue-processor/lib/AwsSqsQueue') or similar for queue classes.
affects: >=1.0.0
gotchaRateLimit requires a running Redis instance; without it the worker will fail silently.
fix
Ensure Redis is configured and accessible at the provided host and port.
affects: >=1.0.0
gotchaMessage attributes must include a 'type' field matching the handler name; otherwise messages are ignored.
fix
Add { type: 'handler-name' } to message attributes.
affects: >=1.0.0
breakingNo TypeScript definitions included; type checking is not available.
fix
Install @types/node-queue-processor or create custom type declarations.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'node-queue-processor/lib/AwsSqsQueue'
Queue classes are in the lib folder but not exposed in package.json main field.
fix
Use correct path: require('node-queue-processor/lib/AwsSqsQueue')
ERR_REQUIRE_ESM: require() of ES Module not supported
Package is CommonJS only, but consumer tries to use ESM import.
fix
Use require() instead of import.
Upgrade
Version history
1.0.9latest on npm
Audit
Dependencies
redisrequiredRequired for RateLimit functionality (rate limiter uses Redis for state management)
Agent activity
10 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
node-queue-processor — npm install node-queue-processor · libregistry