Registry / devops / forkqueue

forkqueue

JSON →
library0.0.8jsnpmunverified

ForkQueue is a simple Node.js queue library (v0.0.8) that uses child_process.fork to distribute queue items to worker processes. Workers request the next item via 'next' messages, enabling parallel processing. It has no dependencies, is minimal and lightweight, but is in early development with no recent updates (last release 0.0.8). Unlike Bull or Bee-Queue, it lacks persistence, prioritization, or advanced features. Suitable for basic parallel task processing in Node.js.

devops
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.

Package uses CommonJS; no default export available for ESM import.

const Queue = require('forkqueue');

First argument must be a number (worker count), second is a string path.

const queue = new Queue(5, './worker.js');

No return value; call synchronously.

queue.enqueue(value);

Creates a queue with 2 workers, enqueues 10 items, and processes them using a worker module.

const Queue = require('forkqueue'); const queue = new Queue(2, './worker.js'); for (let i = 0; i < 10; i++) { queue.enqueue(i); } queue.end(() => { console.log('All workers finished'); }); // worker.js: // process.send('next'); // process.on('message', (value) => { // console.log('Processing:', value); // process.send('next'); // });
Debug
Known footguns
gotchaWorker module path must be absolute or relative to the current working directory
gotchaWorker must send 'next' message before and after processing to continue receiving items
breakingNo error handling for worker crashes; if a worker exits unexpectedly, the queue may hang
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
7 hits · last 30 days
gptbot
3
Resources