
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
ampersand-collection-lodash-mixin
Advanced tools
A mixin for extending ampersand-collection with lodash methods.
Lead Maintainer: Clemens Stolle
A mixin for extending ampersand-collection with a bunch of lodash methods.
If you're using an ampersand-rest-collection this is already mixed in for you.
Out of the box, ampersand-collections proxy the ES5 iteration methods already so you don't have to use this mixin, but if you want lodash methods, or better browser support, you can use this.
This mixin adds the following lodash methods:
countBy, difference, drop, each, every, filter, find, findWhere, first,
forEach, groupBy, includes, indexOf, initial, invoke, invokeMap, isEmpty, keyBy, last,
lastIndexOf, map, max, min, partition, pluck, reduce, reduceRight, reject,
sample, shuffle, size, some, sortBy, take, tail, where, without
It weighs in at about 7.5kb gzipped.
npm install ampersand-collection-lodash-mixin
var Collection = require('ampersand-collection');
var lodashMixin = require('ampersand-collection-lodash-mixin');
module.exports = Collection.extend(lodashMixin, {
sampleMethod: function () {
// now we've got lodash methods
// we can call that are applied to models
// in the collection.
this.filter( ... );
this.some( ... );
this.each( ... )
}
});
All credit for underscore and this approach in backbone goes to Jeremy Ashkenas and the rest of the Backbone and Underscore authors. All credit for lodash goes to John-David Dalton.
Big thanks to @STRML who generously gave us this module name on npm. If you're interested in his version, it's still there public, you can just keep using version 1.0.2.
If you like this follow @HenrikJoreteg and/or @klaemo on twitter.
MIT
FAQs
A mixin for extending ampersand-collection with lodash methods.
The npm package ampersand-collection-lodash-mixin receives a total of 3,519 weekly downloads. As such, ampersand-collection-lodash-mixin popularity was classified as popular.
We found that ampersand-collection-lodash-mixin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.