{"id":47913008,"url":"https://github.com/lukecarr/brec","last_synced_at":"2026-04-04T05:24:59.809Z","repository":{"id":341047560,"uuid":"1168695167","full_name":"lukecarr/brec","owner":"lukecarr","description":"A task runner for the Bun ecosystem.","archived":false,"fork":false,"pushed_at":"2026-02-27T18:06:11.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-27T21:51:01.755Z","etag":null,"topics":["bun","task-runner"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/brec","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukecarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["lukecarr"]}},"created_at":"2026-02-27T17:32:15.000Z","updated_at":"2026-02-27T18:06:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lukecarr/brec","commit_stats":null,"previous_names":["lukecarr/brec"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lukecarr/brec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukecarr%2Fbrec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukecarr%2Fbrec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukecarr%2Fbrec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukecarr%2Fbrec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukecarr","download_url":"https://codeload.github.com/lukecarr/brec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukecarr%2Fbrec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31388763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bun","task-runner"],"created_at":"2026-04-04T05:24:59.730Z","updated_at":"2026-04-04T05:24:59.802Z","avatar_url":"https://github.com/lukecarr.png","language":"TypeScript","funding_links":["https://github.com/sponsors/lukecarr"],"categories":[],"sub_categories":[],"readme":"# brec\n\n\u003e A task runner for the Bun ecosystem. (Bun RECipes)\n\nDefine recipes in TypeScript. Run them from the command line. Dependencies are resolved as a directed acyclic graph (DAG) and run with maximum concurrency.\n\n## Install\n\n```sh\nbun add -d brec\n```\n\n## Quick start\n\nCreate a `brec.ts` or `brec.js` in your project root:\n\n```js\nimport { recipe, $ } from \"brec\";\n\nexport const clean = recipe(\"Remove build artifacts\", () =\u003e $`rm -rf ./build`);\n\nexport const build = recipe(\n  () =\u003e $`bun build ./src/index.ts --outdir ./build --target bun`,\n  [clean],\n);\n```\n\nList available recipes:\n\n```console\n$ brec\n  clean  Remove build artifacts\n  build\n```\n\nRun a recipe:\n\n```console\n$ brec build\n▶ clean\n▶ build\n```\n\n## API\n\n### recipe()\n\nCreates a recipe. Call it with a description and a run function. Optionally pass recipe dependencies as a third argument.\n\n```ts\nrecipe(description: string, run: Task, deps?: Recipe[]): Recipe\nrecipe(run: Task, deps?: Recipe[]): Recipe\n```\n\n- **description**: optional text that appears when you list recipes\n- **run**: the function to execute (`Task` is a type alias for `() =\u003e void | Promise\u003cany\u003e`)\n- **deps**: optional other recipes that must run first\n\nDependencies run before the recipe. Independent dependencies run concurrently.\n\nExample:\n\n```js\nexport const lint = recipe(\"Lint the codebase\", () =\u003e { ... });\nexport const test = recipe(\"Run tests\", () =\u003e { ... });\n\n// both \"lint\" and \"test\" run (in parallel) before \"ci\"\nexport const ci = recipe(\"CI pipeline\", async () =\u003e { ... }, [lint, test]);\n\n// shorthand (description is optional)\nexport const build = recipe(() =\u003e $`bun build`, [clean]);\n```\n\n### $\n\nA re-export of Bun's built-in [shell](https://bun.sh/docs/runtime/shell) tagged template literal. Use it to run shell commands inside recipes.\n\n```js\nexport const dev = recipe(\"Start dev server\", () =\u003e $`bun run dev`);\n```\n\n## Recipes\n\nBrec discovers recipes from the exports of your `brec.ts` or `brec.js` file.\n\n### Named exports\n\nEach named export that is a `Recipe` becomes available as a recipe. The export name is the recipe name.\n\n```js\nexport const lint = recipe(\"Lint the codebase\", () =\u003e { ... });\nexport const test = recipe(\"Run tests\", () =\u003e { ... });\n```\n\n```console\n$ brec\n  lint  Lint the codebase\n  test  Run tests\n```\n\n### Default export\n\nExport a `Recipes` as the default export to create recipes dynamically.\n\n```ts\nimport { recipe, type Recipes } from \"brec\";\n\nconst services = [\"api\", \"web\", \"worker\"];\n\nexport default Object.fromEntries(\n  services.map((s) =\u003e [\n    `deploy-${s}`,\n    recipe(`Deploy the ${s} service`, async () =\u003e { ... }),\n  ]),\n) satisfies Recipes;\n```\n\n```console\n$ brec\n  deploy-api     Deploy the api service\n  deploy-web     Deploy the web service\n  deploy-worker  Deploy the worker service\n```\n\nYou can use both named exports and a default export in the same file.\n\n## Dependencies\n\nPass recipe variables directly as dependencies. This gives you type safety and ensures referenced recipes exist.\n\n```js\nconst clean = recipe(() =\u003e $`rm -rf dist`);\nconst compile = recipe(() =\u003e $`bun build src/index.ts --outdir dist`);\n\nexport const bundle = recipe(async () =\u003e { ... }, [clean, compile]);\n```\n\nIf there's a cycle in the dependency graph, brec reports an error.\n\n## License\n\nbrec is licensed under the MIT License. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukecarr%2Fbrec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukecarr%2Fbrec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukecarr%2Fbrec/lists"}