{"id":26414914,"url":"https://github.com/gabeduartem/pipe-now","last_synced_at":"2026-02-25T23:02:27.879Z","repository":{"id":32524877,"uuid":"136118881","full_name":"GabeDuarteM/pipe-now","owner":"GabeDuarteM","description":"A pipe function that acts like the pipeline operator proposal.","archived":false,"fork":false,"pushed_at":"2023-01-03T19:15:30.000Z","size":1047,"stargazers_count":4,"open_issues_count":32,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-21T10:33:59.543Z","etag":null,"topics":["helper","helpers","now","operator","pipe","pipeline","tool","tools","util","utils"],"latest_commit_sha":null,"homepage":"https://npm.im/pipe-now","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/GabeDuarteM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-05T04:16:22.000Z","updated_at":"2023-03-10T08:36:22.000Z","dependencies_parsed_at":"2023-01-14T21:31:04.351Z","dependency_job_id":null,"html_url":"https://github.com/GabeDuarteM/pipe-now","commit_stats":null,"previous_names":["gabrielduartem/pipe-now"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/GabeDuarteM/pipe-now","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fpipe-now","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fpipe-now/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fpipe-now/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fpipe-now/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabeDuarteM","download_url":"https://codeload.github.com/GabeDuarteM/pipe-now/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fpipe-now/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29844845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"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":["helper","helpers","now","operator","pipe","pipeline","tool","tools","util","utils"],"created_at":"2025-03-18T00:16:44.936Z","updated_at":"2026-02-25T23:02:27.841Z","avatar_url":"https://github.com/GabeDuarteM.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003epipe-now\u003c/h1\u003e\n\n  \u003cp\u003eA tiny package that simulates the behavior of the \u003ca href=\"https://github.com/tc39/proposal-pipeline-operator\"\u003epipeline-operator proposal\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\n\u003chr /\u003e\n\n[![Build Status][build-badge]][build]\n[![Code Coverage][coverage-badge]][coverage]\n[![version][version-badge]][package]\n[![downloads][downloads-badge]][npmtrends]\n[![MIT License][license-badge]][license]\n\n[![PRs Welcome][prs-badge]][prs]\n[![Code of Conduct][coc-badge]][coc]\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n[![Tweet][twitter-badge]][twitter]\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and\nshould be installed as one of your project's `dependencies`:\n\n```bash\nnpm install --save pipe-now\n```\n\n## The problem\n\nThe pipeline operator is an awesome thing, but unfortunately the proposals available for babel vary quite a bit, and they can still change more, as they are still in early stages of development and there's no agreement on an API yet.\n\n## This solution\n\nThis package tries to solve the problem stated above by simulating the pipeline operator through a function. I know, it's not as nice as having an actual syntax for that, but until the proposal gets more stable this can be a good replacement.\n\n## Usage\n\nThis package exports a function which receives a plain value as the first argument, and all the next arguments are functions that receives the previous value, and returns the next value.\n\nYou can use it with inline functions:\n\n```js\nimport pipe from 'pipe-now'\n\nfunction getFruits() {\n  const fruitsUppercase = ['APPLE', 'BANANA', 'ORANGE']\n  const fruitsLowercase = pipe(\n    fruitsUppercase,\n    (values) =\u003e values.map((value) =\u003e value.toLowerCase()),\n  )\n  return fruitsLowercase // ['apple', 'banana', 'orange']\n}\n```\n\nTo avoid code duplication, you can also extract the functions and just pass the reference to them:\n\n```js\nimport pipe from 'pipe-now'\n\nfunction arrayToLowerCase(arr) {\n  return arr.map((value) =\u003e value.toLowerCase())\n}\n\nfunction getFruits() {\n  const fruitsUppercase = ['APPLE', 'BANANA', 'ORANGE']\n  const fruitsLowercase = pipe(\n    fruitsUppercase,\n    arrayToLowerCase,\n  )\n  return fruitsLowercase // ['apple', 'banana', 'orange']\n}\n```\n\nYou can also check below a more complex use of the `pipe` function, with data fetching and manipulating this data:\n\n```js\nimport pipe from 'pipe-now'\n\n// Simulates an async data fetch\nfunction fetchPeople() {\n  return Promise.resolve({\n    count: 3,\n    results: [\n      {\n        name: 'Luke Skywalker',\n        height: '172',\n      },\n      {\n        name: 'C-3PO',\n        height: '167',\n      },\n      {\n        name: 'Darth Vader',\n        height: '202',\n      },\n    ],\n  })\n}\n\nfunction average(arr) {\n  const sum = arr.reduce((a, b) =\u003e a + b)\n  const avg = sum / arr.length\n\n  return avg\n}\n\nasync function getPeopleHeightAverage() {\n  const peopleHeightAverage = pipe(\n    await fetchPeople(), // Get list of Star Wars people\n    (values) =\u003e values.results, // Get only the `results` property of the response\n    (values) =\u003e values.map((people) =\u003e people.height), // Get only the people height\n    (values) =\u003e values.map(Number), // Convert values from string to number\n    average, // Calculate the average\n    Math.round, // Round the value\n  )\n\n  return peopleHeightAverage // returns 180\n}\n```\n\n## Inspiration\n\n- [The pipeline operator docs on Mozilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Pipeline_operator)\n\n- [The pipeline operator proposal](https://github.com/tc39/proposal-pipeline-operator)\n\n## Other Solutions\n\n### [lodash's `flow`](https://lodash.com/docs/#flow)\n\nYou can kind of use it to simulate the pipeline syntax, like the following:\n\n```js\nconst value = _.flow(\n  () =\u003e 'initial value',\n  (val) =\u003e val.toUpperCase(),\n)()\n```\n\nIf you are already using lodash, you can of course also create a wrapper for that.\n\n## LICENSE\n\nMIT\n\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[build-badge]: https://img.shields.io/travis/com/GabrielDuarteM/pipe-now/master.svg?style=flat-square\n[build]: https://travis-ci.com/GabrielDuarteM/pipe-now\n[coverage-badge]: https://img.shields.io/codecov/c/github/GabrielDuarteM/pipe-now.svg?style=flat-square\n[coverage]: https://codecov.io/github/GabrielDuarteM/pipe-now\n[version-badge]: https://img.shields.io/npm/v/pipe-now.svg?style=flat-square\n[package]: https://www.npmjs.com/package/pipe-now\n[downloads-badge]: https://img.shields.io/npm/dm/pipe-now.svg?style=flat-square\n[npmtrends]: http://www.npmtrends.com/pipe-now\n[license-badge]: https://img.shields.io/github/license/GabrielDuarteM/pipe-now.svg?style=flat-square\n[license]: https://github.com/GabrielDuarteM/pipe-now/blob/master/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/GabrielDuarteM/pipe-now/blob/master/other/CODE_OF_CONDUCT.md\n[github-watch-badge]: https://img.shields.io/github/watchers/GabrielDuarteM/pipe-now.svg?style=social\n[github-watch]: https://github.com/GabrielDuarteM/pipe-now/watchers\n[github-star-badge]: https://img.shields.io/github/stars/GabrielDuarteM/pipe-now.svg?style=social\n[github-star]: https://github.com/GabrielDuarteM/pipe-now/stargazers\n[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20pipe-now%20by%20%40GabrielDuarteM%20https%3A%2F%2Fgithub.com%2FGabrielDuarteM%2Fpipe-now%20%F0%9F%91%8D\n[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/GabrielDuarteM/pipe-now.svg?style=social\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabeduartem%2Fpipe-now","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabeduartem%2Fpipe-now","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabeduartem%2Fpipe-now/lists"}