bind-operator
v1.0.0
Published
Transpiler for http://wiki.ecmascript.org/doku.php?id=strawman:bind_operator
Downloads
2
Readme
bind-operator
Transpiler for http://wiki.ecmascript.org/doku.php?id=strawman:bind_operator
Example
You could write code like:
import {unique, flatten} from "oonderscore";
[1, 2, 3, [3, 2], [1]]::flatten()::unique();
// => [1, 2, 3]
This gets transformed into:
import {unique, flatten} from "oonderscore";
unique.call(flatten.call([1, 2, 3, [3, 2], [1]]));
// => [1, 2, 3]
You can also write code like:
var clickButton = button::click;
which gets transformed to:
var clickButton = click.bind(button);
Installation
npm install bind-operator
or
npm install --global bind-operator
Usage
Via the command line:
bind-operator input.js output.js
bind-operator < input.js > output.js
Via browserify:
Just specify the transform name as bind-operator
.
License
MIT