Initial commit
[yaffs-website] / node_modules / lodash / README.md
1 # Lo-Dash v1.0.2
2
3 A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features).
4
5 ## Download
6
7 * Lo-Dash builds (for modern environments):<br>
8 [Development](https://raw.github.com/lodash/lodash/v1.0.2/dist/lodash.js) and
9 [Production](https://raw.github.com/lodash/lodash/v1.0.2/dist/lodash.min.js)
10
11 * Lo-Dash compatibility builds (for legacy and modern environments):<br>
12 [Development](https://raw.github.com/lodash/lodash/v1.0.2/dist/lodash.compat.js) and
13 [Production](https://raw.github.com/lodash/lodash/v1.0.2/dist/lodash.compat.min.js)
14
15 * Underscore compatibility builds:<br>
16 [Development](https://raw.github.com/lodash/lodash/v1.0.2/dist/lodash.underscore.js) and
17 [Production](https://raw.github.com/lodash/lodash/v1.0.2/dist/lodash.underscore.min.js)
18
19 * For optimal file size, [create a custom build](http://lodash.com/custom-builds) with only the features you need
20
21 ## Dive in
22
23 We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).
24
25 For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).
26
27 The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).
28
29 ## Installation and usage
30
31 In browsers:
32
33 ```html
34 <script src="lodash.js"></script>
35 ```
36
37 Using [`npm`](http://npmjs.org/):
38
39 ```bash
40 npm install lodash
41
42 npm install -g lodash
43 npm link lodash
44 ```
45
46 To avoid potential issues, update `npm` before installing Lo-Dash:
47
48 ```bash
49 npm install npm -g
50 ```
51
52 In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
53
54 ```js
55 var _ = require('lodash');
56
57 // or as a drop-in replacement for Underscore
58 var _ = require('lodash/lodash.underscore');
59 ```
60
61 **Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.
62
63 In [RingoJS v0.7.0-](http://ringojs.org/):
64
65 ```js
66 var _ = require('lodash')._;
67 ```
68
69 In [Rhino](http://www.mozilla.org/rhino/):
70
71 ```js
72 load('lodash.js');
73 ```
74
75 In an AMD loader like [RequireJS](http://requirejs.org/):
76
77 ```js
78 require({
79   'paths': {
80     'underscore': 'path/to/lodash'
81   }
82 },
83 ['underscore'], function(_) {
84   console.log(_.VERSION);
85 });
86 ```
87
88 ## Resources
89
90 For more information check out these articles, screencasts, and other videos over Lo-Dash:
91
92  * Posts
93   - [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
94
95  * Videos
96   - [Introducing Lo-Dash](https://vimeo.com/44154599)
97   - [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
98   - [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600)
99   - [Unit testing in Lo-Dash](https://vimeo.com/45865290)
100   - [Lo-Dash’s approach to native method use](https://vimeo.com/48576012)
101   - [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
102
103 ## Features
104
105  * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
106  * [_(…)](http://lodash.com/docs#_) supports intuitive chaining
107  * [_.at](http://lodash.com/docs#at) for cherry-picking collection values
108  * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
109  * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
110  * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
111  * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
112  * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties
113  * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties
114  * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
115  * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
116  * [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding
117  * [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
118  * [_.where](http://lodash.com/docs#where) supports deep object comparisons
119  * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
120    [and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
121  * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
122    [and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
123  * [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map),
124    [and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands
125
126 ## Support
127
128 Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.