{"id":25517591,"url":"https://github.com/inlustra/task-runner","last_synced_at":"2025-12-15T20:30:12.739Z","repository":{"id":57118727,"uuid":"120020611","full_name":"Inlustra/task-runner","owner":"Inlustra","description":"A child-process management tool and sequencer... it's a tiny pipeline for node","archived":false,"fork":false,"pushed_at":"2018-02-12T07:02:23.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-11T09:42:32.564Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npmjs.com/package/@inlustra/task-runner","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Inlustra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-02T19:12:05.000Z","updated_at":"2024-03-28T11:21:41.000Z","dependencies_parsed_at":"2022-08-22T12:31:02.225Z","dependency_job_id":null,"html_url":"https://github.com/Inlustra/task-runner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inlustra%2Ftask-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inlustra%2Ftask-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inlustra%2Ftask-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inlustra%2Ftask-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Inlustra","download_url":"https://codeload.github.com/Inlustra/task-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239684605,"owners_count":19680163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-19T15:36:00.575Z","updated_at":"2025-12-15T20:30:10.692Z","avatar_url":"https://github.com/Inlustra.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inlustra's Task Runner\n\nA sub-task manager/pipeline to handle child processes.\n\n## Install\n\n```\n  npm i @inlustra/task-manager\n```\n\n## TL:DR\n\nTakes jobs (Child Processes) and handles piping up to a single stream across processes.\nA Task is made up of multiple jobs with a previous job condition (eg. the previous job must be a success)\n\n* Jobs are run consecutively\n* All stage updates (Complete, Error, Cancelled, Skipped) are bubbled up through events.\n* Handles errors without blowing up (If not handled explicitly!)\n\n\n### The simplest way to get tasks running one after the other\n\nCreate a task, made up of multiple jobs, this is the equivalent of a pipeline\n\n```javascript\nconst task = {\n  name: 'A Simple Task',\n  description: 'A task to list some files',\n  jobs: [\n    new ShellJob('ls ./'), // List the files\n    new ShellJob('sleep 5'), // Sleep for 5 seconds\n    new ShellJob('exit 1'), // Then error\n    new ShellJob('echo \"This won\\'t appear!\"') // The task runner won't run this job\n  ]\n}\n\nconst taskHandler = new TaskHandler(task)\ntaskHandler.on(TaskHandler.Events.STAGE_UPDATE, (stages) =\u003e {\n  console.log('The next stage in the task has run!')\n  console.log(stages)\n})\n```\n\n## Using the task runner to add tasks\n\n\n```javascript\nconst task = {\n  name: 'A Simple Task',\n  description: 'A task to list some files',\n  jobs: [\n    new ShellJob('ls ./'), // List the files\n    new ShellJob('sleep 5'), // Sleep for 5 seconds\n    new ShellJob('exit 1'), // Then error\n    new ShellJob('echo \"This won\\'t appear!\"') // The task runner won't run this job\n  ]\n}\n```\n\nRegister the task, add your pipes and start it!\n\n```javascript\nconst taskRunner = new TaskRunner()\ntaskRunner.addGlobalPipe(process.stdout) // Will print all outputs from any tasks to the console\nconst taskKey = taskRunner.register(task)\ntaskRunner.addTaskPipe(taskKey, fs.createWriteStream('./'))\n```\n\n# TODO\n\n- Document the options available (Jobs can run on error)\n- Document the Event types in TaskHandler and TaskRunner\n- Bubble up errors to the developer\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finlustra%2Ftask-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finlustra%2Ftask-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finlustra%2Ftask-runner/lists"}