bind-operator

1.0.0 • Public • Published

bind-operator

Transpiler for http://wiki.ecmascript.org/doku.php?id=strawman:bind_operator

Build Status Dependency Status NPM version

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

Readme

Keywords

none

Package Sidebar

Install

npm i bind-operator

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • forbeslindesay