{"id":46385,"library":"simple-worker","title":"SimpleWorker","description":"SimpleWorker is a straightforward priority job queue library for Node.js (v3.0.1). It uses Redis as a backend for fast, reliable job processing with customizable concurrency and retry logic. Unlike full-featured queue systems like Bull or Bee-Queue, SimpleWorker focuses on minimal setup and a clean API. The library is actively maintained with periodic updates. Key differentiators include a simple configuration, priority support, and worker-level concurrency control. However, documentation is sparse, and the main usage guidance points to a code example.","status":"active","version":"3.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/queicherius/simple-worker","tags":["javascript"],"install":[{"cmd":"npm install simple-worker","lang":"bash","label":"npm"},{"cmd":"yarn add simple-worker","lang":"bash","label":"yarn"},{"cmd":"pnpm add simple-worker","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Redis client for queue storage","package":"redis","optional":false}],"imports":[{"note":"Package ships an ES module; CommonJS require gives default export as an object with .default property.","wrong":"const SimpleWorker = require('simple-worker')","symbol":"default","correct":"import SimpleWorker from 'simple-worker'"},{"note":"Named export for individual worker creation.","wrong":"const Worker = require('simple-worker').Worker","symbol":"Worker","correct":"import { Worker } from 'simple-worker'"},{"note":"Named export for queue instance.","wrong":"const Queue = require('simple-worker').Queue","symbol":"Queue","correct":"import { Queue } from 'simple-worker'"}],"quickstart":{"code":"import SimpleWorker from 'simple-worker';\nimport { createClient } from 'redis';\n\nconst client = createClient({ url: process.env.REDIS_URL ?? 'redis://localhost:6379' });\nconst worker = new SimpleWorker(client, 'myqueue');\n\nworker.process(async (job) => {\n  console.log('Processing job:', job.id);\n  return job.data;\n});\n\nworker.on('completed', (job) => {\n  console.log('Job completed:', job.id);\n});\n\nworker.on('failed', (job, err) => {\n  console.error('Job failed:', job.id, err);\n});\n\nworker.start();\n\n// Add a job\nawait worker.add({ payload: 'hello' }, { priority: 1 });","lang":"typescript","description":"Basic setup of a SimpleWorker with Redis client, job processing, event listeners, and job addition."},"warnings":[{"fix":"Use a separate Redis instance for testing.","message":"Tests clear production Redis instances; do not run tests against production.","severity":"gotcha","affected_versions":"all"},{"fix":"Use SimpleWorker constructor with Redis client and queue name.","message":"From v2 to v3, the API changed from class-based to functional; old instantiation syntax no longer works.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Switch to ioredis or update to redis v4.","message":"The `redis` package v3 is deprecated; use `ioredis` or `redis` v4.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Ensure job data is plain objects/arrays with serializable values.","message":"Job data must be serializable to JSON; functions or circular references cause errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use async functions in worker.process().","message":"v3 removed callback-based processing; only async/await is supported.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'activ':54 'api':50 'backend':18 'bee':40 'bee-queu':39 'bull':37 'clean':49 'code':85 'concurr':26,71 'configur':64 'control':72 'customiz':25 'differenti':60 'document':74 'exampl':86 'fast':20 'featur':33 'focus':43 'full':32 'full-featur':31 'guidanc':81 'howev':73 'includ':61 'javascript':87 'job':7,22 'key':59 'level':70 'librari':9,52 'like':36 'logic':29 'main':79 'maintain':55 'minim':45 'node.js':11 'period':57 'point':82 'prioriti':6,65 'process':23 'queue':8,34,41 'redi':15 'reliabl':21 'retri':28 'setup':46 'simpl':63 'simplework':1,2,42 'spars':76 'straightforward':5 'support':66 'system':35 'unlik':30 'updat':58 'usag':80 'use':14 'v3.0.1':12 'worker':69 'worker-level':68","created_at":"2026-06-07T12:59:40.059515+00:00","updated_at":"2026-06-07T12:59:40.059515+00:00","problems":[{"fix":"Ensure job.add() receives a plain object with serializable values.","cause":"Job data is not serializable because it contains a function.","error":"Error: Job data must be a plain object. Received: [Function]"},{"fix":"Upgrade to v3 API: import SimpleWorker and use new SimpleWorker() constructor.","cause":"Using old v2 API where process was a method on Queue class.","error":"TypeError: worker.process is not a function"},{"fix":"Pass a valid Redis client instance to the SimpleWorker constructor.","cause":"Missing Redis client configuration.","error":"ERR! config.redis is required"},{"fix":"Run npm install redis.","cause":"redis package is a peer dependency and not installed.","error":"Error: Cannot find module 'redis'"}],"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/queicherius/simple-worker","github":"https://github.com/queicherius/simple-worker","docs":null,"changelog":null,"pypi":null,"npm":"simple-worker","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"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}}