Registry / devops / queue-proccessor

queue-proccessor

JSON →
library0.1.8jsnpmunverified

A lightweight queue processor for managing asynchronous task dispatch, version 0.1.8, with moderate release cadence. Provides a centralized queue that can be started and stopped, ensuring messages are processed sequentially to avoid loss from unawaited promises. Simpler alternatives include bull or async queues, but this package offers minimal setup and built-in TypeScript types.

npm install queue-proccessor
INSTALL
IMPORT
SIG · QUEUE-PROCCESSOR
Q
queue-proccessor
devopsjavascriptv0.1.8
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.

QueueProccessor
import { QueueProccessor } from "queue-proccessor"
import QueueProccessor from "queue-proccessor"
Named export only. Default import will not work.
QueueProccessor
const { QueueProccessor } = require("queue-proccessor")
const QueueProccessor = require("queue-proccessor")
CommonJS destructure required because it's a named export.
QueueProccessor<Type>
const queue = new QueueProccessor<number>(handler)
const queue = new QueueProccessor(handler)
TypeScript generic is optional but recommended for type safety.

Demonstrates creating a QueueProccessor with a typed async handler, adding items, starting and stopping the queue.

import { QueueProccessor } from "queue-proccessor"; async function handler(data: { id: number }) { return new Promise<void>((resolve) => { setTimeout(() => { console.log("Processed:", data.id); resolve(); }, 100); }); } const queue = new QueueProccessor<{ id: number }>(handler); queue.add({ id: 1 }); queue.add({ id: 2 }); queue.start(); setTimeout(() => queue.stop(), 500); console.log("Length:", queue.queueLength);
Debug
Known issues
gotchaPackage name is misspelled 'proccessor' (double c) - ensure import path matches exactly.
fix
Use 'queue-proccessor' in package.json and imports.
affects: <=0.1.8
gotchaadd() method does not return a promise; errors inside handler will not be caught by add() caller.
fix
Wrap handler errors manually or use a global error handler.
affects: <=0.1.8
breakingstop() does not prevent the current handler from finishing; isProccessing remains true until handler completes.
fix
Check isProccessing after stop() to ensure queue fully stopped.
affects: <=0.1.8
gotchaGeneric type parameter is optional but if omitted, data will be typed as Object.
fix
Always specify the generic type for type safety, e.g., QueueProccessor<number>.
affects: <=0.1.8
deprecatedNo official deprecation warnings, but package has low maintenance; consider migrating to more robust solutions like bull or async-queue.
fix
Evaluate alternatives if reliability is critical.
affects: <=0.1.8
Errors
Common errors & fixes
TypeError: queue_proccessor_1.QueueProccessor is not a constructor
Default import used instead of named import.
fix
import { QueueProccessor } from 'queue-proccessor'
Cannot find module 'queue-proccessor' or its corresponding type declarations.
Package might not be installed or TypeScript cannot resolve types.
fix
npm install queue-proccessor && ensure tsconfig.json includes node_modules
Property 'start' does not exist on type 'QueueProccessor<Object>'.
Wrong import or older version where method names differed.
fix
Use import { QueueProccessor } from 'queue-proccessor' and check package version.
Upgrade
Version history
0.1.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
queue-proccessor — npm install queue-proccessor · libregistry