nor-function
Function utilities for JavaScript and Node.js
Usage
Install from NPM: npm install -d nor-function
this
.curry() -- Faster bind() implementation without var FUNCTION = ; { return a + b;} var sum_10 = ; 30 === ;30 === ;
this
.bind() -- Faster bind() implementation with support for var FUNCTION = ; var obj = 'base': 100 { return thisbase + a + b; }; var sum_10 = ; 130 === obj;130 === ;
See our benchmarks:
mapping-with-bind x 142,370 ops/sec ±2.04% (83 runs sampled)
mapping-with-custom-bind-2-ifelse x 617,267 ops/sec ±2.88% (77 runs sampled)
mapping-with-custom-bind-2 x 588,005 ops/sec ±2.91% (78 runs sampled)
mapping-with-custom-bind-3 x 635,116 ops/sec ±2.10% (82 runs sampled)
mapping-with-custom-bind-predefined x 608,043 ops/sec ±2.47% (78 runs sampled)
mapping-with-custom-bind x 509,248 ops/sec ±2.75% (84 runs sampled)
mapping-with-function x 592,160 ops/sec ±2.81% (80 runs sampled)
mapping-with-inline-functions x 486,078 ops/sec ±5.05% (82 runs sampled)
mapping-with-nor-function x 590,456 ops/sec ±2.03% (82 runs sampled)
mapping-with-predefined-bind x 198,182 ops/sec ±3.46% (86 runs sampled)
mapping-with-predefined-function x 635,431 ops/sec ±5.07% (76 runs sampled)
Fastest is mapping-with-custom-bind-3,mapping-with-predefined-function,mapping-with-custom-bind-2-ifelse
Serialize function to String
var FUNCTION = ; { return a + b; }var str = ;str === "function foo(a, b) { return a + b; }";
Unserialize string to function
var FUNCTION = ;var str = "function foo(a, b) { return a + b; }";var fun = FUNCTION; === 30;
License
Commercial Support
You can buy commercial support from Sendanor.