Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/elclanrs/essential.js

Essential JS - Functional JavaScript "the right way"
https://github.com/elclanrs/essential.js

Last synced: 18 days ago
JSON representation

Essential JS - Functional JavaScript "the right way"

Awesome Lists containing this project

README

        

![essential.js](http://i.imgur.com/CalNHKK.png)

**Latest:** 1.1.20
**Compatibility:** Node, ES5, Common, AMD
**License:** MIT

```
npm install essentialjs
```

```javascript
// Add functions to global namespace,
// `global` for Node or `window` for browser
require('essentialjs').expose(global)
```

## Highlights

Essential.js is an alternative to [Underscore.js](http://underscorejs.org/) that gives you a solid base to get started with functional programming in JavaScript:

- All non-variadic functions with more than one argument are curried.
- Arguments are in proper order for better composition.
- Includes a few helpers not found in Underscore.
- Inspired by [Brian Lonsdorf's](https://github.com/DrBoolean) talk, [Hey Underscore, You're Doing it Wrong](https://www.youtube.com/watch?v=m3svKOdZijA).

## API

```coffeescript
module.exports = {
# Core
_, id, K,
builtin, toArray,
variadic, apply, applyNew,
ncurry, λ, curry, partial,
flip, flip3, nflip,
unary, binary, nary,
compose, pcompose, sequence, over,
notF, not:notF, eq, notEq, typeOf, isType,
toObject, extend, deepExtend, deepClone, forOwn,
fold, fold1, foldr, foldr1, map, filter, any, all, each, indexOf, concat,
slice, first, last, rest, initial, take, drop,
inArray, remove, tails, uniqueBy, unique, dups,
flatten, union, intersection, flatMap,
pluck, deepPluck, where, deepWhere,
values, pairs, interleave, intersperse, intercalate,
zip, zipWith, zipObject, unzipObject,
range, shuffle,
sortBy, groupBy, countBy,
format, template, gmatch, permutations, combinations, powerset,
# Fantasy
fmap, ap, chain, liftA, seqM
}
```