babel-plugin-transform-opipe

1.0.0 • Public • Published

babel-plugin-transform-opipe npm (scoped) NpmLicense David Travis (.com) Coveralls github

A babel parser and plugin implementing the opipe operator, to easily pipe an object.

const _ = require('lodash');
const ten = [1,2,3,4]
    :| _.filter( n=>n%2 ) // [1,3]
    :| _.map( n=>n**2 )   // [1,9]
    :| _.sum();           // 10

Installation

npm install --save-dev babel-plugin-transform-opipe

Opipe operator

The opipe operator is defined as following:

:| b(...args) ≡ b(a, ...args)

It's handy to quickly and easily pipe objects through method-like-functions that accept their logical this as the first parameter.

Quickstart

Install the babel suite, enable this plugin, then use babel to transpile your code The easiest way to get started, is the following:

npm install --save babel-plugin-transform-opipe babel-meta
npx babel-node --plugins='babel-plugin-transform-opipe' your_opipeful_file.js

Package Sidebar

Install

npm i babel-plugin-transform-opipe

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

5.89 kB

Total Files

4

Last publish

Collaborators

  • peoro