npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

bind-operator

1.0.0

@forbeslindesay

npmHomeRepoSnykSocket
Downloads:86
$ npm install bind-operator
DailyWeeklyMonthlyYearly

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