@rung/babel-plugin-pipe-operator

1.0.0 • Public • Published

@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
| round

Turn 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-operator

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["@rung/pipe-operator-curry"]
}

Via CLI

$ babel --plugins @rung/pipe-operator-curry script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["@rung/pipe-operator-curry"]
});

License

MIT

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i @rung/babel-plugin-pipe-operator

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • haskellcamargo