babel-plugin-pull
Transform pipeline operator into
pull(...)
calls
This inspired from similar pipe operator plugins to use pull-stream
, which provides you a whole ecosystem + composing them together!
Install
npm install --save-dev babel-plugin-pull # with yarn: yarn add --dev babel-plugin-pull
Then load it in your Babel config:
"plugins": "pull"
Usage
It takes input as such:
| |
And transforms to:
This allows you to use duplex streams, and compose them!
Composition
You can create streams from other streams:
// Create a source:var foo = | // Create a through:var bar = | // Create a sink:var qux = | | // Reuse any of them in another pipeline:foo | bar | qux
This would transform to:
var foo = var bar = var qux =