1.0.0 • Published 8 years ago
@rung/babel-plugin-pipe-operator v1.0.0
@rung/babel-plugin-pipe-operator
This work is a fork of a fork. It's based on https://github.com/Swizz/babel-plugin-pipe-operator-curry, however, it integrates without problems with other plugins.
Examples
import { mean, round } from 'lodash';
const array = [1, 2, 3, 4, 5];
array
| mean
| roundTurn into
import { mean, round } from 'lodash';
const array = [1, 2, 3, 4, 5];
(round)((mean)(array))Disabling in current scope
If you want to use the original pipe operator, you can disable this plugin in current scope (and it children scopes) using "no pipe" directive as described in the original one.
Installation
$ npm install --save-dev @rung/babel-plugin-pipe-operatorUsage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["@rung/pipe-operator-curry"]
}Via CLI
$ babel --plugins @rung/pipe-operator-curry script.jsVia Node API
require("babel-core").transform("code", {
plugins: ["@rung/pipe-operator-curry"]
});License
MIT
1.0.0
8 years ago