{"id":15854086,"url":"https://github.com/afeiship/pipe","last_synced_at":"2026-05-04T11:01:48.209Z","repository":{"id":42230524,"uuid":"204229523","full_name":"afeiship/pipe","owner":"afeiship","description":"Pipe is a lightweight JavaScript library for function composition and execution.","archived":false,"fork":false,"pushed_at":"2025-07-10T00:52:26.000Z","size":479,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-10T10:10:26.902Z","etag":null,"topics":["compose","fn","pipe","pipe-async","pipe-sync"],"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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-08-25T00:58:00.000Z","updated_at":"2025-07-10T00:52:30.000Z","dependencies_parsed_at":"2024-10-05T19:40:58.250Z","dependency_job_id":"b68634ce-cbf4-4a14-a968-78e1fae3ce06","html_url":"https://github.com/afeiship/pipe","commit_stats":null,"previous_names":["afeiship/pipe"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/pipe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fpipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fpipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fpipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fpipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/pipe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fpipe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32604587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"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":["compose","fn","pipe","pipe-async","pipe-sync"],"created_at":"2024-10-05T19:40:47.300Z","updated_at":"2026-05-04T11:01:48.202Z","avatar_url":"https://github.com/afeiship.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pipe\n\u003e Pipe is a lightweight JavaScript library for function composition and execution.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```shell\nnpm install @jswork/pipe\n```\n\n## methods\n- [x] pipe === pipe.sync\n- [x] pipe.sync (default)\n- [x] pipe.async\n\n## usage\n```js\nimport pipe from '@jswork/pipe';\n\n// fns\nfunction addOne(n: number): number {\n  return n + 1;\n}\n\nfunction double(n: number): number {\n  return n * 2;\n}\n\nfunction divide(n: number): number {\n  if (n === 0) {\n    throw new Error('Divide by zero error.');\n  }\n  return 10 / n;\n}\n\n// use pipe\nconst calculate = pipe(\n  addOne,\n  double,\n  divide,\n  addOne\n);\n\nconst result1 = calculate(3);\nconst result2 = calculate(-1);\n\n// has result, without log\nconsole.log('Result1:', result1); // 10 / (3 + 1)*2  + 1 = 2.25\n// has result, but with warning log\nconsole.log('Result2:', result2); // 10 / (-1+1)*2 + 1 =\u003e Throw error: Divide by zero error.\n```\n\n## pipe vs compose\n- compose：常见于函数式编程库如 Redux、Ramda，因为其与数学定义一致。\n- pipe：常见于像 Elm、F# 或者 RxJS 中，因为它更符合“先做什么，再做什么”的自然阅读顺序。\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/pipe/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/pipe\n[version-url]: https://npmjs.org/package/@jswork/pipe\n\n[license-image]: https://img.shields.io/npm/l/@jswork/pipe\n[license-url]: https://github.com/afeiship/pipe/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/pipe\n[size-url]: https://github.com/afeiship/pipe/blob/master/dist/pipe.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/pipe\n[download-url]: https://www.npmjs.com/package/@jswork/pipe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fpipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fpipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fpipe/lists"}