npm install operators
|8||downloads in the last week|
|33||downloads in the last month|
|Version||0.1.4 last updated a year ago|
|Keywords||associative, binary, curried, lifted, operators, haskell, FP, ES5|
and easy to remember interface for addition, multiplication, concatenation, and-ing, or-ing, as
well as several two parameter lambdas for non-associative operators, and curried
versions of the binary operators for quick creation of the functions that you end up writing for
filter all the time.
Attach it to the short variable of choice:
var $ = require('operators');
[1,3,2,6,5,4].filter($.gt(4)); // [ 6, 5 ] [1,2,3,4].map($.plus(1)); // [ 2, 3, 4, 5 ] [1,2,3,4].map($.pow(2)); // [ 1, 4, 9, 16 ] [1,2,3,2].filter($.eq(2)); // [ 2, 2 ] [ [1,2], [3,4] ].map($.prepend()); // [ [ 0, 1, 2 ], [ 0, 3, 4 ] ]
Read the API.
We advocate using this module with one of the utility libraries it was made for:
But they will obviously work well by themselves.
$ npm install operators
Install development dependencies
$ npm install
Run the tests
$ npm test
MIT-Licensed. See LICENSE file for details.