{"id":16712898,"url":"https://github.com/gabrielcsapo/run-then","last_synced_at":"2025-03-15T05:18:12.592Z","repository":{"id":70619893,"uuid":"146353570","full_name":"gabrielcsapo/run-then","owner":"gabrielcsapo","description":"🚲 do something when, a text parser with purpose","archived":false,"fork":false,"pushed_at":"2018-09-05T06:47:42.000Z","size":10,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T01:53:29.320Z","etag":null,"topics":["automation","unix","utility"],"latest_commit_sha":null,"homepage":"https://gabrielcsapo.github.io/run-then","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielcsapo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-27T20:57:08.000Z","updated_at":"2021-05-03T04:04:59.000Z","dependencies_parsed_at":"2023-03-18T14:02:51.389Z","dependency_job_id":null,"html_url":"https://github.com/gabrielcsapo/run-then","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"ce86a65cfa0f40a1c9eec7e23bfa2190d4e529e4"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Frun-then","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Frun-then/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Frun-then/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Frun-then/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielcsapo","download_url":"https://codeload.github.com/gabrielcsapo/run-then/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243672426,"owners_count":20328764,"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":["automation","unix","utility"],"created_at":"2024-10-12T20:44:31.467Z","updated_at":"2025-03-15T05:18:12.569Z","avatar_url":"https://github.com/gabrielcsapo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# run-then\n\n\u003e 🚲 do something when, a text parser with purpose\n\n[![Npm Version](https://img.shields.io/npm/v/run-then.svg)](https://www.npmjs.com/package/run-then)\n[![Build Status](https://travis-ci.org/gabrielcsapo/run-then.svg?branch=master)](https://travis-ci.org/gabrielcsapo/run-then)\n[![Coverage Status](https://lcov-server.gabrielcsapo.com/badge/github%2Ecom/gabrielcsapo/run-then.svg)](https://lcov-server.gabrielcsapo.com/coverage/github%2Ecom/gabrielcsapo/run-then)\n[![Dependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/run-then/status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/run-then)\n[![devDependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/run-then/dev-status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/run-then#info=devDependencies)\n[![npm](https://img.shields.io/npm/dt/run-then.svg)]()\n[![npm](https://img.shields.io/npm/dm/run-then.svg)]()\n\n## What is this?\n\nHave you ever had a process that takes a long time to finish? Ever want to be alerted or have something happen when that is done? Maybe a long grep or a process that takes awhile to build, but don't have control over the underlying tooling?\n\n```\nls . | grep \"foo\" | run-then\n```\n\nThis will check the rules at the following locations:\n\n```\n/{homedir}/.runrc\n/{cwd}/.runrc\n```\n\n## What do the configs look like?\n\n\u003e An example can be found in `/example` with a `README` to show how to run it.\n\n```js\nmodule.exports = {\n  default: [{\n    when: /^foo bar/,\n    do: async function() {\n      console.log('hi');\n    }\n  }],\n  verbose: [{\n    when: /(.+?)/,\n    noOutput: true,\n    do: async function(data) {\n      console.log(`${Date()} ${data.trim()}`);\n    }\n  }],\n  finished: [{\n    onExit: true,\n    do: async function(data) {\n      console.log('done!');\n    }\n  }]\n}\n```\n\nThe default command will be executed when run like:\n\n```\nls . | grep \"foo\" | run-then\n```\n\nRules can be chained or run one at a time like such:\n\n```\nls . | grep \"foo\" | run-then verbose finished\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcsapo%2Frun-then","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielcsapo%2Frun-then","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcsapo%2Frun-then/lists"}