babel-plugin-pipe-composition
Overload the bitwise operators (<<
) and (>>
) to provide to provide F# like pipe forward/backward behavior
This is an alternative to babel-plugin-pipe-operator and babel-plugin-pipe-operator-curry and favors the currying approach.
Examples
; const array = 1 2 3 4 5; let result = array >> >> ; let result = << << array;
Disabling in current scope
If you want to use the original bitwise operators, you can disable this plugin in current scope (and child scopes) using "no pipe"
directive
const fn = { const arr = 1 2 3 >> ; return { "no pipe"; arr; };}; const fn = { const arr = << 1 2 3; return { "no pipe"; arr; };};
Installation
$ npm install --save-dev babel-plugin-pipe-composition
Usage
.babelrc
(Recommended)
Via .babelrc
Via CLI
$ babel --plugins pipe-composition script.js
Via Node API
;
License
MIT