https://github.com/nektro/js-pipeline
(pipeline-operator on npm) Functional implementation of the pipeline operator |>
https://github.com/nektro/js-pipeline
esnext pipeline-operator polyfill
Last synced: about 2 months ago
JSON representation
(pipeline-operator on npm) Functional implementation of the pipeline operator |>
- Host: GitHub
- URL: https://github.com/nektro/js-pipeline
- Owner: nektro
- License: mit
- Created: 2018-04-13T01:47:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-13T14:39:59.000Z (about 8 years ago)
- Last Synced: 2026-03-18T05:26:36.154Z (3 months ago)
- Topics: esnext, pipeline-operator, polyfill
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js-pipeline
pipeline-operator : A functional implementation of the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator)
[](https://nodei.co/npm/pipeline-operator/)
## Installation
on the web:
```html
```
via npm:
> NOTE: Module support in Node still is experimental.
> Node 8 does not support it.
> Node 9 requires a flag and special file extension.
> See the [Node API Docs](https://nodejs.org/api/esm.html) for up-to-date information.
```bash
$ npm install --save pipeline-operator
```
via yarn:
```bash
$ yarn add pipeline-operator
```
## Basic Usage
```js
// done with |>
let result = "hello"
|> doubleSay
|> capitalize
|> exclaim;
// import with pipeline (npm)
import pipeline from "pipeline-operator";
// import on web
import pipeline from "./pipeline-operator/index.js";
// equivalent code
let result = pipeline(
"hello",
doubleSay,
capitalize,
exclaim
);
```
## Credits
- [Follow the proposal!](https://github.com/tc39/proposal-pipeline-operator)
- [See the inspiration](https://gist.github.com/jonathanKingston/4df71289a2cd8dd8306a)
## License
MIT, see [LICENSE](LICENSE)