Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Andarist/pipeline.macro
🎣 A babel macro which works similarly to the pipeline operator.
https://github.com/Andarist/pipeline.macro
babel-plugin-macros composition pipe pipeline
Last synced: about 2 months ago
JSON representation
🎣 A babel macro which works similarly to the pipeline operator.
- Host: GitHub
- URL: https://github.com/Andarist/pipeline.macro
- Owner: Andarist
- Created: 2018-11-10T10:18:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-25T13:58:29.000Z (over 5 years ago)
- Last Synced: 2024-07-19T10:48:19.049Z (2 months ago)
- Topics: babel-plugin-macros, composition, pipe, pipeline
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 36
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pipeline.macro
[![Babel Macro](https://img.shields.io/badge/babel--macro-%F0%9F%8E%A3-f5da55.svg?style=flat-square)](https://github.com/kentcdodds/babel-plugin-macros)
A babel macro which works similarly to [the pipeline operator](https://github.com/tc39/proposal-pipeline-operator).
## Usage
```js
import pipe from 'pipeline.macro'const doubleSay = str => str + ', ' + str
const capitalize = str => str[0].toUpperCase() + str.substring(1)
const exclaim = str => str + '!'const result = pipe(
'hello',
doubleSay,
capitalize,
exclaim,
)result // "Hello, hello!"
```