{"id":46060,"library":"reactor","title":"reactor","description":"A work queue that pivots events to error-first callbacks. Version 13.0.4 provides an asynchronous task queue library for Node.js, allowing developers to define and run tasks with error-first callbacks. It offers a flexible and efficient way to manage work queues, similar to Cadence. The library is maintained and follows a regular release cadence. Unlike other task queues, reactor focuses on converting event-driven flows into callback-based patterns, making it suitable for scenarios like batch processing or workflow orchestration with explicit error handling.","status":"active","version":"13.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/bigeasy/reactor","tags":["javascript","cadence","queue","asynchronous","graph","make","rake"],"install":[{"cmd":"npm install reactor","lang":"bash","label":"npm"},{"cmd":"yarn add reactor","lang":"bash","label":"yarn"},{"cmd":"pnpm add reactor","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for asynchronous control flow management","package":"cadence","optional":false}],"imports":[{"note":"ESM-only; if using CommonJS, use dynamic import or ensure Node.js version supports it.","wrong":"const Reactor = require('reactor')","symbol":"Reactor","correct":"import { Reactor } from 'reactor'"},{"note":"ESM-only; default export is not available, use named import.","wrong":"const { createReactor } = require('reactor')","symbol":"createReactor","correct":"import { createReactor } from 'reactor'"},{"note":"ReactorTask is a named export, not a default export.","wrong":"import ReactorTask from 'reactor'","symbol":"ReactorTask","correct":"import { ReactorTask } from 'reactor'"}],"quickstart":{"code":"import { createReactor } from 'reactor';\nimport { cadence } from 'cadence';\n\nconst work = createReactor(function (step) {\n  step(function (step) {\n    step(console.log, 'Hello, world!');\n    step();\n  });\n});\n\nwork(function (error) {\n  if (error) console.error(error);\n  else console.log('Complete');\n});","lang":"javascript","description":"Demonstrates creating a reactor work queue with a simple task that logs a message and handles completion or error via a callback."},"warnings":[{"fix":"Convert require() calls to import statements; use dynamic import if necessary.","message":"Version 13.x dropped CommonJS support; all imports must use ESM syntax.","severity":"breaking","affected_versions":">=13.0.0"},{"fix":"Replace 'new Reactor()' with 'createReactor()'.","message":"The default export 'Reactor' is deprecated as of v13; use named 'createReactor' instead.","severity":"deprecated","affected_versions":">=13.0.0"},{"fix":"Install cadence: npm install cadence","message":"Missing 'cadence' peer dependency causes runtime errors; it must be installed separately.","severity":"gotcha","affected_versions":">=13.0.0"},{"fix":"Ensure step() is called exactly once per callback to continue the workflow.","message":"Reactor tasks must always call step() to advance the queue; forgetting to invoke step() causes hangs.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'13.0.4':14 'allow':23 'asynchron':17,94 'base':74 'batch':82 'cadenc':48,58,92 'callback':12,34,73 'callback-bas':72 'convert':66 'defin':26 'develop':24 'driven':69 'effici':40 'error':10,32,89 'error-first':9,31 'event':7,68 'event-driven':67 'explicit':88 'first':11,33 'flexibl':38 'flow':70 'focus':64 'follow':54 'graph':95 'handl':90 'javascript':91 'librari':20,50 'like':81 'maintain':52 'make':76,96 'manag':43 'node.js':22 'offer':36 'orchestr':86 'pattern':75 'pivot':6 'process':83 'provid':15 'queue':4,19,45,62,93 'rake':97 'reactor':1,63 'regular':56 'releas':57 'run':28 'scenario':80 'similar':46 'suitabl':78 'task':18,29,61 'unlik':59 'version':13 'way':41 'work':3,44 'workflow':85","created_at":"2026-06-07T12:58:04.781061+00:00","updated_at":"2026-06-07T12:58:04.781061+00:00","problems":[{"fix":"npm install cadence","cause":"Cadence peer dependency not installed.","error":"Error: Cannot find module 'cadence'"},{"fix":"Use 'createReactor' named import.","cause":"Using deprecated default export 'Reactor' in v13.0.4.","error":"TypeError: Reactor is not a constructor"},{"fix":"Add \"type\": \"module\" to package.json or rename file to .mjs.","cause":"Running ESM import in a CommonJS project without proper configuration.","error":"SyntaxError: Cannot use import statement outside a module"}],"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":"http://bigeasy.github.com/reactor","github":"https://github.com/bigeasy/reactor","docs":null,"changelog":null,"pypi":null,"npm":"reactor","openapi_spec":null,"status_page":null,"smithery":null,"categories":["productivity"],"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}}