funkyjs

0.2.2 • Public • Published

funkyjs - Functional JavaScript Build Status

Documentation

For now, look through the code.

Examples

var F = require('funkyjs');
var _ = require('underscore');
 
// funkyjs
var newList = F('map', F('range', 4), F('incr'));
 
// JavaScript + Underscore
var newList = _.map(_.range(4), function(el) {
  return el += 1;
});
 
// funkyjs
var array = (
  F('sortBy',
    F('zip',
      F('shuffle', F('range', 62)),
      F('shuffle', F('range', 62))), F('sum-array')));
 
// JavaScript + Underscore
var array = (
  _.sortBy(
    _.zip(_.shuffle(_.range(62)), _.shuffle(_.range(62))),
    function() {
      return _.reduce(
        _.toArray(arguments),
        function(memo, el) {
          return memo + el;
        },
        0
      );
    }
  )
);

Even better...

# funkyjs + CoffeeScript 
array = (
  ('sortBy',
    ('zip',
      ('shuffle'('range'62)),
      ('shuffle'('range'62)))('sum-array')))

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

License

Copyright (c) 2013 Vail Gold
Licensed under the MIT license.

/funkyjs/

    Package Sidebar

    Install

    npm i funkyjs

    Weekly Downloads

    9

    Version

    0.2.2

    License

    none

    Last publish

    Collaborators

    • vail130