Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

babel-plugin-pull

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-pull

Transform pipeline operator into pull(...) calls

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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:

source()
| through()
| sink()

And transforms to:

pull(
  source(),
  through(),
  sink()
)

This allows you to use duplex streams, and compose them!

Composition

You can create streams from other streams:

// Create a source:
var foo = source() | through()

// Create a through:
var bar = through() | through()

// Create a sink:
var qux = through() | through() | sink()

// Reuse any of them in another pipeline:
foo | bar | qux

This would transform to:

var foo = pull(source(), through())

var bar = pull(through(), through())

var qux = pull(through(), through(), sink())

pull(foo, bar, qux)

Keywords

babel

FAQs

Package last updated on 02 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts