{"id":15314256,"url":"https://github.com/barelyhuman/pipe","last_synced_at":"2026-01-06T23:05:52.669Z","repository":{"id":65552745,"uuid":"594581993","full_name":"barelyhuman/pipe","owner":"barelyhuman","description":"An adaptable and tiny pipe utility","archived":false,"fork":false,"pushed_at":"2023-02-27T05:56:45.000Z","size":138,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-04T19:41:31.640Z","etag":null,"topics":["async","functional","javascript","pipe","utility"],"latest_commit_sha":null,"homepage":"","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/barelyhuman.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},"funding":{"liberapay":"reaper","ko_fi":"barelyreaper","github":"barelyhuman","custom":"https://barelyreaper.gumroad.com/coffee"}},"created_at":"2023-01-29T01:29:46.000Z","updated_at":"2023-04-11T16:07:11.000Z","dependencies_parsed_at":"2025-02-01T20:44:54.411Z","dependency_job_id":"59c18db7-f5d6-4e01-a626-4d440a1be82e","html_url":"https://github.com/barelyhuman/pipe","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barelyhuman%2Fpipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barelyhuman%2Fpipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barelyhuman%2Fpipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barelyhuman%2Fpipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barelyhuman","download_url":"https://codeload.github.com/barelyhuman/pipe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245896693,"owners_count":20690322,"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":["async","functional","javascript","pipe","utility"],"created_at":"2024-10-01T08:44:52.894Z","updated_at":"2026-01-06T23:05:52.663Z","avatar_url":"https://github.com/barelyhuman.png","language":"TypeScript","funding_links":["https://liberapay.com/reaper","https://ko-fi.com/barelyreaper","https://github.com/sponsors/barelyhuman","https://barelyreaper.gumroad.com/coffee"],"categories":[],"sub_categories":[],"readme":"# @barelyhuman/pipe\n\nA tiny pipe utility\n\n![npm](https://img.shields.io/npm/v/@barelyhuman/pipe?colorA=black\u0026colorB=black\u0026logoColor=black)\n\n## Why?\n\nTired of copying it around\n\n## Highlights\n\n- Tiny API\n- Clonable\n- Lazy Execution\n- Plugins\n\n## Usage\n\nThe util was built to abstract async manipulation from the actual flow and make\nit look cleaner when working with arrays\n\nThis is primarily for dealing with nested function calls and hiding the async\nlogic\n\nEg:\n\n```js\nconst value = await Promise.all(something.map(id =\u003e fetchById(id)))\n\n// Could be written as\n\n// before v0.2.3\nconst value = await pipe(something)\n  .map(id =\u003e fetchById(id))\n  .to(x =\u003e Promise.all(x))\n  .run()\n\n// from v0.2.3\nconst value = await pipe(something)\n  .map(id =\u003e fetchById(id))\n  .run()\n\n// or if you don't like magic then, but at this point\n// there's no difference between this and the original\n// statement\nconst value = await pipe(something)\n  .to(previous =\u003e previous.map(id =\u003e fetchById(id)))\n  .to(x =\u003e Promise.all(x))\n  .run()\n```\n\n### Clonable\n\nThe pipes are clonable and each have their own scope\n\nA very simple example would be\n\nEg:\n\n```js\nconst basePipe = pipe(1).to(x =\u003e x * 2)\nconst nextPipe = pipe(basePipe).to(x =\u003e x * 3)\n\nconst valTwo = await nextPipe.run() // 6\nconst valOne = await basePipe.run() // 2\n```\n\n### Lazy Execution\n\nAs shown in the examples the actual execution of the given data isn't started\nunless `.run` is triggered. This makes it easier to transfer context around if\nneeded and in a defined sequence, also makes it easier to extend.\n\n### Plugins\n\nYou can read about them in [PLUGINS.md](/PLUGINS.md)\n\n[MIT](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarelyhuman%2Fpipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarelyhuman%2Fpipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarelyhuman%2Fpipe/lists"}