Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 237 lines (183 sloc) 9.834 kb
60fbeb0 @jdalton Bump to v0.2.1.
jdalton authored
1 # Lo-Dash <sup>v0.2.1</sup>
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
2
6dc10ac @jdalton Add links to relevant sections in the description.
jdalton authored
3 A drop-in replacement for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), that delivers [performance improvements](http://jsperf.com/lodash-underscore#filterby=family), [bug fixes](https://github.com/bestiejs/lodash#closed-underscorejs-issues), and [additional features](https://github.com/bestiejs/lodash#features).
4382a1d @jdalton Cleanup the README.md.
jdalton authored
4
511e226 @jdalton Bump to v0.2.0.
jdalton authored
5 Lo-Dash’s performance is gained by avoiding slower native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
6
7 ## Dive in
8
511e226 @jdalton Bump to v0.2.0.
jdalton authored
9 We’ve got [API docs](http://lodash.com/docs) and [unit tests](http://lodash.com/tests).
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
10
11 For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
12
7800515 @jdalton Cleanup and prep for v0.2.0.
jdalton authored
13 ## Screencasts
6b7310c @jdalton lodash: Move the screencast note higher in the README.md. [jddalton]
jdalton authored
14
4382a1d @jdalton Cleanup the README.md.
jdalton authored
15 For more information check out these screencasts over Lo-Dash:
16
7800515 @jdalton Cleanup and prep for v0.2.0.
jdalton authored
17 * [Introducing Lo-Dash](http://dl.dropbox.com/u/513327/allyoucanleet/post/20/file/screencast.mp4)
b12cdba @jdalton Cleanup README.md.
jdalton authored
18 * [Optimizations and custom builds](http://dl.dropbox.com/u/513327/allyoucanleet/post/21/file/screencast.mp4)
6b7310c @jdalton lodash: Move the screencast note higher in the README.md. [jddalton]
jdalton authored
19
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
20 ## Features
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
21
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
22 * AMD loader support
23 * [_.bind](http://lodash.com/docs#_bindfunc--arg1-arg2-) supports *"lazy"* binding
511e226 @jdalton Bump to v0.2.0.
jdalton authored
24 * [_.debounce](http://lodash.com/docs#_debouncefunc-wait-immediate)’ed functions match [_.throttle](http://lodash.com/docs#_throttlefunc-wait)’ed functions’ return value behavior
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
25 * [_.forEach](http://lodash.com/docs#_foreachcollection-callback--thisarg) is chainable
1d57430 @jdalton Update docdown submodule and README.md.
jdalton authored
26 * [_.groupBy](http://lodash.com/docs#_groupbycollection-callback--thisarg) accepts a third, `thisArg`, argument
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
27 * [_.partial](http://lodash.com/docs#_partialfunc--arg1-arg2-) for more functional fun
1d57430 @jdalton Update docdown submodule and README.md.
jdalton authored
28 * [_.size](http://lodash.com/docs#_sizecollection) supports returning the `length` of string values
87ac01e @jdalton lodash: Add sections to README.md. [jddalton]
jdalton authored
29
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
30 ## Support
87ac01e @jdalton lodash: Add sections to README.md. [jddalton]
jdalton authored
31
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
32 Lo-Dash has been tested in at least Chrome 5-19, Firefox 1.5-12, IE 6-9, Opera 9.25-11.64, Safari 3.0.4-5.1.3, Node.js 0.4.8-0.6.18, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC3.
7800515 @jdalton Cleanup and prep for v0.2.0.
jdalton authored
33
34 ## Custom builds
35
4382a1d @jdalton Cleanup the README.md.
jdalton authored
36 Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
7800515 @jdalton Cleanup and prep for v0.2.0.
jdalton authored
37 We handle all the method dependency and alias mapping for you.
38
39 Custom builds may be created in two ways:
40
41 1. Use the`include` argument to pass the names of the methods to include in the build.
42 ~~~ bash
43 node build include=each,filter,map,noConflict
44 node build include="each, filter, map, noConflict"
45 ~~~
46
47 2. Use the `exclude` argument to pass the names of the methods to exclude from the build.
48 ~~~ bash
511e226 @jdalton Bump to v0.2.0.
jdalton authored
49 node build exclude=isNaN,isUndefined,union,zip
50 node build exclude="isNaN, isUndefined, union, zip"
7800515 @jdalton Cleanup and prep for v0.2.0.
jdalton authored
51 ~~~
52
53 Custom builds are saved to `lodash.custom.js` and `lodash.custom.min.js`.
87ac01e @jdalton lodash: Add sections to README.md. [jddalton]
jdalton authored
54
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
55 ## Installation and usage
56
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
57 In browsers:
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
58
59 ~~~ html
60 <script src="lodash.js"></script>
61 ~~~
62
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
63 Using [npm](http://npmjs.org/):
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
64
65 ~~~ bash
66 npm install lodash
67 ~~~
68
69 In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
70
71 ~~~ js
72 var _ = require('lodash');
73 ~~~
74
75 In [Narwhal](http://narwhaljs.org/) and [RingoJS v0.7.0-](http://ringojs.org/):
76
77 ~~~ js
78 var _ = require('lodash')._;
79 ~~~
80
81 In [Rhino](http://www.mozilla.org/rhino/):
82
83 ~~~ js
84 load('lodash.js');
85 ~~~
86
87 In an AMD loader like [RequireJS](http://requirejs.org/):
88
89 ~~~ js
90 require({
91 'paths': {
bdd05e4 @jdalton lodash: Add support for more AMD build optimizers and allow aliasing …
jdalton authored
92 'underscore': 'path/to/lodash'
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
93 }
94 },
bdd05e4 @jdalton lodash: Add support for more AMD build optimizers and allow aliasing …
jdalton authored
95 ['underscore'], function(_) {
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
96 console.log(_.VERSION);
97 });
98 ~~~
99
100 ## Cloning this repo
101
102 To clone this repository including all submodules, using Git 1.6.5 or later:
103
104 ~~~ bash
105 git clone --recursive https://github.com/bestiejs/lodash.git
106 cd lodash.js
107 ~~~
108
109 For older Git versions, just use:
110
111 ~~~ bash
112 git clone https://github.com/bestiejs/lodash.git
113 cd lodash
114 git submodule update --init
115 ~~~
116
511e226 @jdalton Bump to v0.2.0.
jdalton authored
117 ## Closed Underscore.js issues
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
118
7e71b5b @jdalton Reword unit test and add entry to README.md.
jdalton authored
119 * Ensure `_(...)` returns passed wrapper instances [[test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L95-98)]
cca6a94 @jdalton Cleanup README.md.
jdalton authored
120 * Ensure `_.groupBy` adds values to own, not inherited, properties [[test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L229-236)]
121 * Ensure `_.throttle` works when called in tight loops [[#502](https://github.com/documentcloud/underscore/issues/502), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L436-446)]
60fbeb0 @jdalton Bump to v0.2.1.
jdalton authored
122 * Fix Firefox, IE, Opera, and Safari object iteration bugs [[#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L152-172), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L206-213), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L255-257), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L265-267), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L285-292), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L386-388)]
123 * Handle arrays with `undefined` values correctly in IE < 9 [[#601](https://github.com/documentcloud/underscore/issues/601)]
cca6a94 @jdalton Cleanup README.md.
jdalton authored
124 * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L77-83)]
60fbeb0 @jdalton Bump to v0.2.1.
jdalton authored
125 * Register as AMD module, but still export to global [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/32627f45072952df18a64cf5e9f2433d2d32730f/test/test.js#L61-75)]
126 * `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L74-77)]
1d57430 @jdalton Update docdown submodule and README.md.
jdalton authored
127 * `_isNaN(new Number(NaN))` should return `true` [[test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L95-99)]
128 * `_.reduceRight` should pass correct callback arguments when iterating objects [[test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L106-116)]
129 * `_.size` should return the `length` of string values [[test](https://github.com/bestiejs/lodash/blob/5bcd444084c92b1753feeaf66c20323e57a2dac3/test/test.js#L121-127)]
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
130
131 ## Optimized methods <sup>(50+)</sup>
132
133 * `_.bind`
134 * `_.bindAll`
135 * `_.clone`
136 * `_.compact`
137 * `_.contains`, `_.include`
138 * `_.defaults`
139 * `_.defer`
140 * `_.difference`
141 * `_.each`
142 * `_.escape`
143 * `_.every`, `_.all`
144 * `_.extend`
145 * `_.filter`, `_.select`
146 * `_.find`, `_.detect`
147 * `_.flatten`
148 * `_.forEach`, `_.each`
149 * `_.functions`, `_.methods`
150 * `_.groupBy`
151 * `_.indexOf`
e9501a1 @jdalton Update changelog with `intersect` removal.
jdalton authored
152 * `_.intersection`
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
153 * `_.invoke`
154 * `_.isEmpty`
155 * `_.isEqual`
156 * `_.isFinite`
157 * `_.isObject`
158 * `_.isString`
159 * `_.keys`
160 * `_.lastIndexOf`
161 * `_.map`, `_.collect`
162 * `_.max`
163 * `_.memoize`
164 * `_.min`
165 * `_.mixin`
166 * `_.pick`
167 * `_.pluck`
168 * `_.reduce`, `_.foldl`, `_.inject`
169 * `_.reject`
170 * `_.result`
171 * `_.shuffle`
172 * `_.some`, `_.any`
173 * `_.sortBy`
174 * `_.sortedIndex`
175 * `_.template`
176 * `_.throttle`
177 * `_.toArray`
178 * `_.union`
179 * `_.uniq`, `_.unique`
180 * `_.values`
181 * `_.without`
182 * `_.wrap`
183 * `_.zip`
184 * plus all `_(...)` method wrappers
185
186 ## Changelog
187
60fbeb0 @jdalton Bump to v0.2.1.
jdalton authored
188 ### <sup>v0.2.1</sup>
189
190 * Adjusted the Lo-Dash export order for r.js
cca6a94 @jdalton Cleanup README.md.
jdalton authored
191 * Ensured `_.groupBy` values are added to own, not inherited, properties
60fbeb0 @jdalton Bump to v0.2.1.
jdalton authored
192 * Made `_.bind` follow ES5 spec to support a popular Backbone.js pattern
e9501a1 @jdalton Update changelog with `intersect` removal.
jdalton authored
193 * Removed the alias `intersect`
cca6a94 @jdalton Cleanup README.md.
jdalton authored
194 * Simplified `_.bind`, `_.flatten`, `_.groupBy`, `_.max`, and `_.min`
60fbeb0 @jdalton Bump to v0.2.1.
jdalton authored
195
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
196 ### <sup>v0.2.0</sup>
197
198 * Added custom build options
199 * Added default `_.templateSettings.variable` value
200 * Added *"lazy bind"* support to `_.bind`
201 * Added native method overwrite detection to avoid bad native shims
202 * Added support for more AMD build optimizers and aliasing as the *"underscore"* module
1d57430 @jdalton Update docdown submodule and README.md.
jdalton authored
203 * Added `thisArg` argument to `_.groupBy`
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
204 * Added whitespace to compiled strings
1d57430 @jdalton Update docdown submodule and README.md.
jdalton authored
205 * Added `_.partial` method
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
206 * Commented the `iterationFactory` options object
7e71b5b @jdalton Reword unit test and add entry to README.md.
jdalton authored
207 * Ensured `_(...)` returns passed wrapper instances
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
208 * Ensured `_.max` and `_.min` support extremely large arrays
cca6a94 @jdalton Cleanup README.md.
jdalton authored
209 * Ensured `_.throttle` works in tight loops
511e226 @jdalton Bump to v0.2.0.
jdalton authored
210 * Fixed IE < 9 `[DontEnum]` bug and Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1’s prototype property iteration bug
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
211 * Inlined `_.isFunction` calls.
511e226 @jdalton Bump to v0.2.0.
jdalton authored
212 * Made `_.debounce`’ed functions match `_.throttle`’ed functions’ return value behavior
a868ac5 @jdalton Update README.md for version bump.
jdalton authored
213 * Made `_.escape` no longer translate the *">"* character
214 * Fixed `clearTimeout` typo
215 * Simplified all methods in the *"Arrays"* category
216 * Optimized `_.debounce`, `_.escape`, `_.flatten`, `_.forEach`, `_.groupBy`, `_.intersection`, `_.invoke`, `_.isObject`, `_.max`, `_.min`, `_.pick`, `_.shuffle`, `_.sortedIndex`, `_.template`, `_.throttle`, `_.union`, `_.uniq`
217
218 ### <sup>v0.1.0</sup>
219
220 * Initial release
221
222 ## BestieJS
223
224 Lo-Dash is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
7800515 @jdalton Cleanup and prep for v0.2.0.
jdalton authored
225
8e65243 @jdalton lodash: Rename to `lodash` and update support files. [jddalton]
jdalton authored
226 ## Author
227
228 * [John-David Dalton](http://allyoucanleet.com/)
229 [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
d65f68f @jdalton lodash: Cleanup build scripts and add @kitcambridge as a contributor.…
jdalton authored
230
231 ## Contributors
232
233 * [Kit Cambridge](http://kitcambridge.github.com/)
234 [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
a4b8528 @jdalton lodash: Add @mathiasbynens as a contributor. [jddalton]
jdalton authored
235 * [Mathias Bynens](http://mathiasbynens.be/)
236 [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")
Something went wrong with that request. Please try again.