Lightweight functional utility library complementing ES5
Autonomy is a lightweight functional helper library. It is meant to complement an ES5 style with curried helpers, math helpers, curried accessors and higher order looping constructs.
Attach it to the short variable of choice:
var $ = require'autonomy';
and get functional:
$idx === x;$noopx === undefined;var fn = $fn1 fn2 fn3;fna; // fn3(fn2(fn1(a)))132map$constant5; // [5, 5, 5]12343filter$elem13; // [ 1, 3, 3 ]135-1some$notElem12345; // true$gcd10 15; // 5123456filter$even; // [ 2, 4, 6 ]$range5; // [ 1, 2, 3, 4, 5 ]$zip$range5 12 325; // [ [ 1, 1, 3 ], [ 2, 2, 2 ] ]$zipWith$gcd 5 10 15 $range5; // [ 1, 2, 3 ]$iterate3 "ha!"return "ha" + str; // [ 'ha!', 'haha!', 'hahaha!' ]12 34map$invoke'join''w'; // [ '1w2', '3w4']
Read the read the API.
In most cases the operators module provides some almost must have additions to autonomy.
This modules makes up the core part of the larger utility library: interlude. If you find yourself co-using
subset, you should use
interlude instead (there's also more documentation included for interlude).
$ npm install autonomy
Install development dependencies
$ npm install
Run the tests
$ npm test
MIT-Licensed. See LICENSE file for details.