Skip to content

jasonlevinsohn/lodash

 
 

Repository files navigation

Lo-Dash v2.0.0

A utility library delivering consistency, customization, performance, & extras.

Download

CDN copies are available on cdnjs & jsDelivr.
For smaller file sizes, create custom builds with only the features needed. Love modules? We’ve got you covered with lodash-amd, lodash-node, and npm packages per method.

Dive in

There’s plenty of documentation, unit tests, & benchmarks.

For a list of upcoming features, check out our roadmap.

Features not in Underscore

Resources

  • Posts
  • Videos

Support

Tested in Chrome 529, Firefox 223, IE 6-10, Opera 9.25~15, Safari 3-6, Node.js 0.6.8-0.10.18, Narwhal 0.3.2, PhantomJS 1.9.1, RingoJS 0.9, & Rhino 1.7RC5.

Installation & usage

In browsers:

<script src="lodash.js"></script>

Using npm:

npm i lodash

{sudo} npm i -g lodash
npm link lodash

In Node.js & Ringo:

var _ = require('lodash');
// or as Underscore
var _ = require('lodash/dist/lodash.underscore');

Notes:

  • Don’t assign values to special variable _ when in the REPL
  • If Lo-Dash is installed globally, run npm link lodash in your project’s root directory before requiring it
  • Node.js 0.10.8-0.10.11 have bugs preventing minified builds

In Rhino:

load('lodash.js');

In an AMD loader:

require({
  'packages': [
    { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }
  ]
},
['lodash'], function(_) {
  console.log(_.VERSION);
});

Release Notes

v2.0.0

Compatibility Warnings

  • Aligned _.after with Underscore 1.5.0, making it always return a function

Noteable Changes

Other Changes

  • Added Curl & Dojo module loaders to the unit tests
  • Added the modularize build option
  • Added support for the iife command to be used without an %output% token
  • Added support for _.mixin to accept a destination object
  • Added support for _.range to accept a step of 0
  • Added _.eachRight as an alias for _.forEachRight
  • Ensured “Arrays” methods support arguments objects
  • Ensured “Functions” methods throw when not passed functions
  • Ensured _.at works as a callback for _.map
  • Ensured _.createCallback works when no argCount is specified
  • Ensured _.first & _.last return arrays when passed a falsey array with an n value
  • Ensured _.flatten works with arguments objects
  • Ensured minified files work with Dojo’s builder
  • Ensured _.zipObject skips falsey elements
  • Improved dead code removal from builds
  • Improved JSDoc syntax
  • Made _.memoize avoid prefixing cache keys when using a resolver function
  • Made _.unzip an alias of _.zip
  • Removed local clearTimeout & setTimeout variables from the underscore build
  • Reduced the size of the repo & npm package
  • Simplified the bailout in createCache
  • Updated sourceURL & sourceMappingURL syntax
  • Updated underscore build compatibility to v1.5.2

The full changelog is available here.

BestieJS

Lo-Dash is part of the BestieJS “Best in Class” module collection. This means it promotes solid environment support, ES5+ precedents, unit testing, & plenty of documentation.

Author

twitter/jdalton
John-David Dalton

Contributors

twitter/blainebublitz twitter/kitcambridge twitter/mathias
Blaine Bublitz Kit Cambridge Mathias Bynens

About

A utility library delivering consistency, customization, performance, and extras.

Resources

License

Stars

Watchers

Forks

Packages

No packages published