# ampersand-collection-lodash-mixin

> A mixin for extending ampersand-collection with lodash methods.

Latest version **4.0.0** (published 2016-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install ampersand-collection-lodash-mixin
pnpm add ampersand-collection-lodash-mixin
yarn add ampersand-collection-lodash-mixin
bun add ampersand-collection-lodash-mixin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2016-05-25 |
| First published | 2014-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Henrik Joreteg |
| Maintainers | henrikjoreteg, klaemo, lukekarrys, strml |
| Keywords | ampersand, collection, underscore, lodash |

## Links

- npm: https://www.npmjs.com/package/ampersand-collection-lodash-mixin
- Repository: https://github.com/ampersandjs/ampersand-collection-lodash-mixin
- Issues: https://github.com/ampersandjs/ampersand-collection-lodash-mixin/issues
- npm.io page: https://npm.io/package/ampersand-collection-lodash-mixin

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.6.1
- [ampersand-version](https://npm.io/package/ampersand-version.md) ^1.0.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2016-05-25
- 3.0.0 — 2016-05-25
- 2.0.1 — 2015-04-11
- 2.0.0 — 2015-04-02
- 1.0.2 — 2014-10-05
- 1.0.1 — 2014-10-05

## README

# ampersand-collection-lodash-mixin

Lead Maintainer: [Clemens Stolle](https://github.com/klaemo)

A mixin for extending ampersand-collection with a bunch of lodash methods.

If you're using an [ampersand-rest-collection](http://ampersandjs.com/docs/#ampersand-rest-collection) this is already mixed in for you.

Out of the box, ampersand-collections proxy the [ES5 iteration methods already](http://ampersandjs.com/docs/#ampersand-collection-proxied-es5-array-methods-9) 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.

## install

```
npm install ampersand-collection-lodash-mixin
```

## example

```javascript
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( ... )
    }
});
```

## credits

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](https://github.com/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](http://twitter.com/henrikjoreteg) and/or [@klaemo](http://twitter.com/klaemo) on twitter.

## license

MIT

---
_Source: https://npm.io/package/ampersand-collection-lodash-mixin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
