{"id":46816,"library":"workers-pipeline","title":"workers-pipeline","description":"A minimal wrapper around the 'queue' library providing QueueWorker and WorkersPipeline classes for limiting concurrent async operations. Current version 0.0.1 (pre-1.0). Lightweight, TypeScript-friendly. Wraps jessetane/queue, adds class-based worker pattern. Intended for simple job queues with concurrency control, but the API is minimal and the package is very early stage.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/arthurkarganyan/queue-worker","tags":["javascript","queue","typescript"],"install":[{"cmd":"npm install workers-pipeline","lang":"bash","label":"npm"},{"cmd":"yarn add workers-pipeline","lang":"bash","label":"yarn"},{"cmd":"pnpm add workers-pipeline","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"runtime dependency for underlying queue implementation","package":"queue","optional":false}],"imports":[{"note":"Package is ESM/CJS hybrid, named export.","wrong":"const QueueWorker = require('workers-pipeline').QueueWorker","symbol":"QueueWorker","correct":"import { QueueWorker } from 'workers-pipeline'"},{"note":"Default import does not work; named export only.","wrong":"import WorkersPipeline from 'workers-pipeline'","symbol":"WorkersPipeline","correct":"import { WorkersPipeline } from 'workers-pipeline'"},{"note":"When using QueueWorker as base class in TypeScript, you can import type to avoid bundling runtime dependency.","wrong":"","symbol":"QueueWorker (type only)","correct":"import type { QueueWorker } from 'workers-pipeline'"}],"quickstart":{"code":"import { QueueWorker, WorkersPipeline } from 'workers-pipeline'\n\nclass HardWorker extends QueueWorker {\n  private payload: any\n  constructor(payload: any) {\n    super()\n    this.payload = payload\n  }\n  protected async call(that: HardWorker) {\n    // Process this.payload\n    console.log(this.payload)\n  }\n}\n\nconst pipeline = new WorkersPipeline(2)\npipeline.push(new HardWorker({ url: 'https://example.com' }))\npipeline.push(new HardWorker({ url: 'https://example.org' }))\nawait pipeline.start()\nconsole.log('All workers done')","lang":"typescript","description":"Shows how to define a custom QueueWorker subclass with payload, create a WorkersPipeline with concurrency limit 2, push workers, and await completion."},"warnings":[{"fix":"Pin version and test upgrades.","message":"The package is at version 0.0.1 – no stability guarantees; API may change at any time.","severity":"breaking","affected_versions":"0.0.1"},{"fix":"Use the 'that' parameter or bind methods correctly.","message":"The call method receives 'that' as a parameter, not 'this' – this can cause confusion if you rely on 'this' context.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Manage pipeline state manually; ensure start() is called only once.","message":"WorkersPipeline.push does not return anything; no error handling for duplicate pushes or pipeline already started.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Wrap await pipeline.start() in try/catch and handle errors per worker.","message":"No documentation on error handling – if a worker throws, the pipeline may hang or reject unexpectedly.","severity":"missing","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'-1.0':25 '0.0.1':23 'add':32 'api':48 'around':7 'async':19 'base':35 'class':15,34 'class-bas':33 'concurr':18,44 'control':45 'current':21 'earli':56 'friend':29 'intend':38 'javascript':58 'jessetane/queue':31 'job':41 'librari':10 'lightweight':26 'limit':17 'minim':5,50 'oper':20 'packag':53 'pattern':37 'pipelin':3 'pre':24 'provid':11 'queue':9,42,59 'queuework':12 'simpl':40 'stage':57 'typescript':28,60 'typescript-friend':27 'version':22 'worker':2,36 'workers-pipelin':1 'workerspipelin':14 'wrap':30 'wrapper':6","created_at":"2026-06-07T13:01:46.167816+00:00","updated_at":"2026-06-07T13:01:46.167816+00:00","problems":[{"fix":"npm install queue --save","cause":"Missing peer dependency 'queue'","error":"Cannot find module 'queue'"},{"fix":"Use import { WorkersPipeline } from 'workers-pipeline'","cause":"Importing WorkersPipeline incorrectly (default import instead of named)","error":"TypeError: pipeline.start is not a function"},{"fix":"Ensure constructor calls super() and assigns this.payload","cause":"In call(that), 'that' is undefined because super() not called or constructor missing","error":"TypeError: Cannot read property 'payload' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/arthurkarganyan/queue-worker#readme","github":"https://github.com/arthurkarganyan/queue-worker","docs":null,"changelog":null,"pypi":null,"npm":"workers-pipeline","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}