{"id":38762502,"url":"https://github.com/egeozcan/ppipe","last_synced_at":"2026-01-21T07:54:52.061Z","repository":{"id":8508898,"uuid":"58663677","full_name":"egeozcan/ppipe","owner":"egeozcan","description":"pipes values through functions, an alternative to using the proposed pipe operator ( |\u003e ) for ES","archived":false,"fork":false,"pushed_at":"2025-09-07T04:29:17.000Z","size":502,"stargazers_count":193,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-17T21:26:02.623Z","etag":null,"topics":["async","chain","pipe","pipe-operator","pipes-values","promise"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/egeozcan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-05-12T17:45:37.000Z","updated_at":"2024-08-16T15:57:00.000Z","dependencies_parsed_at":"2025-08-13T12:16:38.514Z","dependency_job_id":null,"html_url":"https://github.com/egeozcan/ppipe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/egeozcan/ppipe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egeozcan%2Fppipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egeozcan%2Fppipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egeozcan%2Fppipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egeozcan%2Fppipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egeozcan","download_url":"https://codeload.github.com/egeozcan/ppipe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egeozcan%2Fppipe/sbom","scorecard":{"id":368605,"data":{"date":"2025-08-11","repo":{"name":"github.com/egeozcan/ppipe","commit":"14e5f6b9b84f7a4012f04bb8b89cf2d5b84e47ca"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T12:27:25.422Z","repository_id":8508898,"created_at":"2025-08-18T12:27:25.422Z","updated_at":"2025-08-18T12:27:25.422Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28629917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["async","chain","pipe","pipe-operator","pipes-values","promise"],"created_at":"2026-01-17T11:58:27.772Z","updated_at":"2026-01-21T07:54:52.053Z","avatar_url":"https://github.com/egeozcan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![PPIPE](logo/logo_s.png)](https://github.com/egeozcan/ppipe)\n\n[![build](https://travis-ci.org/egeozcan/ppipe.svg?branch=master)](https://travis-ci.org/egeozcan/ppipe)\n[![Coverage Status](https://coveralls.io/repos/github/egeozcan/ppipe/badge.svg?branch=master)](https://coveralls.io/github/egeozcan/ppipe?branch=master)\n[![npm](https://img.shields.io/npm/v/ppipe.svg)](https://www.npmjs.com/package/ppipe)\n[![npm](https://img.shields.io/npm/dt/ppipe.svg)](https://www.npmjs.com/package/ppipe)\n[![license](https://img.shields.io/github/license/egeozcan/ppipe.svg)](https://github.com/egeozcan/ppipe/blob/master/LICENSE)\n\n**Strictly-typed pipes for values through functions**, an alternative to using the\n[proposed pipe operator](https://github.com/tc39/proposal-pipeline-operator) ( |\u003e ) for ES.\n\nVersion 3.0 is a complete TypeScript rewrite with **maximum type safety** - no `any` in the public API, full IDE autocomplete support, and correct type inference throughout the chain.\n\n## Installation\n\n```bash\nnpm install ppipe\n```\n\n## Quick Start\n\n```typescript\nimport ppipe, { _ } from 'ppipe';\n\nconst add = (x: number, y: number) =\u003e x + y;\nconst square = (x: number) =\u003e x * x;\nconst divide = (x: number, y: number) =\u003e x / y;\nconst double = (x: number) =\u003e x * 2;\n\n// Basic piping\nconst result = ppipe(1)\n  .pipe(add, _, 1)      // 2\n  .pipe(double)         // 4\n  .pipe(square)         // 16\n  .pipe(divide, _, 8)   // 2\n  .pipe(add, _, 1)      // 3\n  .value;\n\nconsole.log(result); // 3\n```\n\n## Features\n\n### Basic Piping\n\nChain functions together, passing the result of each to the next:\n\n```typescript\nppipe('hello')\n  .pipe(s =\u003e s.toUpperCase())\n  .pipe(s =\u003e s + '!')\n  .value; // 'HELLO!'\n```\n\n### Placeholder Positioning\n\nUse `_` to control where the piped value is inserted:\n\n```typescript\nconst _ = ppipe._;\n\n// Value inserted at placeholder position\nppipe(10)\n  .pipe(divide, _, 2)   // divide(10, 2) = 5\n  .value;\n\n// Without placeholder, value is appended at the end\nppipe(10)\n  .pipe(divide, 100)    // divide(100, 10) = 10\n  .value;\n\n// Multiple placeholders insert the same value multiple times\nppipe(5)\n  .pipe((a, b) =\u003e a + b, _, _)  // 5 + 5 = 10\n  .value;\n```\n\n### Async/Promise Support\n\nPromises are automatically handled - the chain waits for resolution and passes the unwrapped value to the next function:\n\n```typescript\nasync function fetchUser(id: number) {\n  const response = await fetch(`/api/users/${id}`);\n  return response.json();\n}\n\nconst userName = await ppipe(1)\n  .pipe(fetchUser)\n  .pipe(user =\u003e user.name)\n  .pipe(name =\u003e name.toUpperCase());\n\n// Or use .then()/.catch()\nppipe(1)\n  .pipe(fetchUser)\n  .pipe(user =\u003e user.name)\n  .then(name =\u003e console.log(name))\n  .catch(err =\u003e console.error(err));\n```\n\n### Value Extraction\n\nGet the current value with `.value` (or `.val`):\n\n```typescript\n// Sync value\nconst num = ppipe(5).pipe(x =\u003e x * 2).value; // 10\n\n// Async value (returns Promise)\nconst asyncNum = await ppipe(Promise.resolve(5)).pipe(x =\u003e x * 2).value;\n```\n\n### Typed Extensions\n\nCreate reusable pipe extensions with full type inference:\n\n```typescript\nconst mathPipe = ppipe.extend({\n  double: (x: number) =\u003e x * 2,\n  square: (x: number) =\u003e x * x,\n  add: (x: number, y: number) =\u003e x + y,\n});\n\nconst result = mathPipe(5)\n  .double()      // 10 - return type inferred as number\n  .square()      // 100\n  .add(5)        // 105\n  .value;\n\n// Extensions can be chained\nconst extendedPipe = mathPipe.extend({\n  stringify: (x: number) =\u003e String(x),\n});\n\nconst str = extendedPipe(5)\n  .double()\n  .stringify()   // '10' - return type inferred as string\n  .value;\n```\n\n### Generic Pass-Through Extensions\n\nGeneric identity functions like `log` or `tap` preserve the pipe's type automatically:\n\n```typescript\nconst pp = ppipe.extend({\n  log: \u003cT\u003e(value: T, label?: string): T =\u003e {\n    console.log(label ?? 'value:', value);\n    return value;\n  },\n});\n\n// Type is preserved through .log() - no type loss!\npp(8)\n  .log('start')     // logs: \"start: 8\"\n  .pipe(x =\u003e x + 3) // x is number, not unknown\n  .log('end')       // logs: \"end: 11\"\n  .value;           // 11\n\npp('hello')\n  .log()\n  .pipe(s =\u003e s.toUpperCase()) // s is string\n  .value;                      // 'HELLO'\n```\n\n## API Reference\n\n### `ppipe(value)`\n\nCreates a new pipe with the given initial value.\n\n```typescript\nconst pipe = ppipe(initialValue);\n```\n\n### `.pipe(fn, ...args)`\n\nPipes the current value through a function. The value is inserted at the placeholder position, or appended at the end if no placeholder is used.\n\n```typescript\npipe.pipe(fn)              // fn(value)\npipe.pipe(fn, _, arg2)     // fn(value, arg2)\npipe.pipe(fn, arg1)        // fn(arg1, value)\npipe.pipe(fn, arg1, _)     // fn(arg1, value)\n```\n\n### `.value` / `.val`\n\nGets the current value from the chain. Returns a Promise if any function in the chain was async.\n\n### `.then(onFulfilled?, onRejected?)`\n\nStandard Promise `then` interface. Always available for consistent async handling.\n\n### `.catch(onRejected?)`\n\nStandard Promise `catch` interface. Always available for consistent async handling.\n\n### `ppipe._`\n\nThe placeholder symbol for argument positioning.\n\n### `ppipe.extend(extensions)`\n\nCreates a new ppipe factory with additional methods:\n\n```typescript\nconst extended = ppipe.extend({\n  methodName: (value, ...args) =\u003e result,\n});\n```\n\nExtension functions receive the piped value as their first argument.\n\n## Migration from v2.x\n\nVersion 3.0 is a TypeScript rewrite that prioritizes type safety. Some dynamic features that couldn't be strictly typed have been removed:\n\n### Removed Features\n\n| Feature | v2.x | v3.x Alternative |\n|---------|------|------------------|\n| Deep property access | `_.a.b.c` | `.pipe(x =\u003e x.a.b.c)` |\n| Array spreading | `..._` | `.pipe(arr =\u003e fn(...arr))` |\n| Direct method access | `.map(fn)` | `.pipe(arr =\u003e arr.map(fn))` |\n| Context binding | `.with(ctx)` | `.pipe(fn.bind(ctx))` |\n| Callable syntax | `ppipe(val)(fn)` | `ppipe(val).pipe(fn)` |\n\n### Why These Changes?\n\nThese features relied on Proxy magic that returned `any` types, breaking TypeScript's ability to infer types correctly. The v3.x API ensures:\n\n- Full IDE autocomplete support\n- Correct type inference throughout the chain\n- No `any` types in the public API\n- Compile-time error detection\n\n## Type Safety\n\nppipe v3.x provides complete type inference:\n\n```typescript\n// Types are inferred correctly through the chain\nconst result = ppipe(5)\n  .pipe(x =\u003e x * 2)           // Pipe\u003cnumber\u003e\n  .pipe(x =\u003e x.toString())    // Pipe\u003cstring\u003e\n  .pipe(x =\u003e x.length)        // Pipe\u003cnumber\u003e\n  .value;                     // number\n\n// Async types are tracked\nconst asyncResult = ppipe(Promise.resolve(5))\n  .pipe(x =\u003e x * 2)           // Pipe\u003cnumber, async=true\u003e\n  .value;                     // Promise\u003cnumber\u003e\n\n// Extension return types are inferred\nconst myPipe = ppipe.extend({\n  toArray: \u003cT\u003e(x: T) =\u003e [x],\n});\n\nmyPipe(5).toArray().value;    // number[]\n\n// Generic identity extensions preserve the pipe's type\nconst debugPipe = ppipe.extend({\n  log: \u003cT\u003e(value: T): T =\u003e { console.log(value); return value; },\n});\n\ndebugPipe(5).log().pipe(x =\u003e x * 2).value;  // x is number, result is number\n```\n\n## Testing\n\n100% test coverage is maintained. To run tests:\n\n```bash\nnpm install\nnpm test\n```\n\n## Contributing\n\nSee [CONTRIBUTING](https://github.com/egeozcan/ppipe/blob/master/.github/CONTRIBUTING.md).\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history.\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegeozcan%2Fppipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegeozcan%2Fppipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegeozcan%2Fppipe/lists"}