https://github.com/willin/pipefn
Pipeline Operator Function Creator
https://github.com/willin/pipefn
Last synced: 9 months ago
JSON representation
Pipeline Operator Function Creator
- Host: GitHub
- URL: https://github.com/willin/pipefn
- Owner: willin
- License: mit
- Created: 2017-09-01T00:45:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-01T03:21:11.000Z (almost 9 years ago)
- Last Synced: 2024-10-29T22:37:31.769Z (over 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pipefn
Pipeline Function Creator
[](https://github.com/willin) [](https://npmjs.org/package/pipefn) [](https://npmjs.org/package/pipefn) [](https://npmjs.org/package/pipefn)  
## Usage
```js
a |> _(fn,b)
//=> fn(a,b)
a |> _(fn,b,c,d)
//=> fn(a,b,c,d)
```
Demo:
```js
const _ = require('pipefn');
const result = [1, 2, 3, 4, 5] |> _([].concat, [6, 7, 8, 9, 0]);
//=> means [].concat([1,2,3,4,5],[6,7,8,9,0])
console.log(result);
//=> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ]
```
## License
MIT
通过支付宝捐赠:
