Latest: 1.1.20
Compatibility: Node, ES5, Common, AMD
License: MIT
npm install essentialjs
// Add functions to global namespace,
// `global` for Node or `window` for browser
require('essentialjs').expose(global)
Essential.js is an alternative to Underscore.js 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 talk, Hey Underscore, You're Doing it Wrong.
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
}