{"id":19793565,"url":"https://github.com/darky/klubok","last_synced_at":"2025-08-27T01:35:15.637Z","repository":{"id":260938919,"uuid":"882016651","full_name":"darky/klubok","owner":"darky","description":"Do notation pipes for Promise-based or pure functions which easy to mock","archived":false,"fork":false,"pushed_at":"2025-07-24T12:09:06.000Z","size":1308,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-22T18:43:42.412Z","etag":null,"topics":["do-notation","functional-programming","javascript","mock","pipe","promise","typescript","unit-testing"],"latest_commit_sha":null,"homepage":"","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/darky.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-01T17:47:26.000Z","updated_at":"2025-07-24T12:09:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae6eb1c5-f173-4f5e-80ec-811a9a99becf","html_url":"https://github.com/darky/klubok","commit_stats":null,"previous_names":["darky/klubok"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darky/klubok","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fklubok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fklubok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fklubok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fklubok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darky","download_url":"https://codeload.github.com/darky/klubok/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fklubok/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272276943,"owners_count":24905368,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["do-notation","functional-programming","javascript","mock","pipe","promise","typescript","unit-testing"],"created_at":"2024-11-12T07:10:21.789Z","updated_at":"2025-08-27T01:35:15.587Z","avatar_url":"https://github.com/darky.png","language":"TypeScript","readme":"# Klubok\n\n![logo](logo.png)\n\nDo notation pipes for Promise-based or pure functions which easy to mock \u003cbr/\u003e\nInspired by fp-ts/Effect `bind` Do-notation, but much more small and simple \u003cbr/\u003e\nPrimarly created for easy mocking of functions, which allows to write tons of unit tests\n\n## Example\n\n```ts\nimport { pure, eff, klubok } from 'klubok';\n\nconst catsBirthdays = klubok(\n  eff('cats', async ({ ids }: { ids: number[] }) =\u003e { /* fetch cats from DB */ }),\n\n  pure('catsOneYearOld', ({ cats }) =\u003e cats.map(cat =\u003e ({ ...cat, age: cat.age + 1 })),\n\n  eff('saved', async ({ catsOneYearOld }) =\u003e { /* save to DB */ })\n)\n\n// production usage\ncatsBirthdays({ ids: [1, 2, 3] })\n\n// in tests usage\ncatsBirthdays(\n  { ids: [1, 2, 3] },\n\n  {\n    // DB response mock\n    cats: () =\u003e [\n      { name: 'Barsik', age: 10 },\n      { name: 'Marfa', age: 7 }\n    ]\n  },\n\n  // call only this functions\n  ['catsOneYearOld']\n\n) // Promise\u003c{ ..., catsOneYearOld: [{ name: 'Barsik', age: 11 }, { name: 'Marfa', age: 8 }] }\u003e\n\n```\n\n## See also\n\n* [Klubok-Gleam](https://github.com/darky/klubok-gleam) - Gleam implementation of Klubok\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fklubok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarky%2Fklubok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fklubok/lists"}