# modella-collector

> Modella plugin to enable collection attributes

Latest version **0.0.5** (published 2014-04-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install modella-collector
pnpm add modella-collector
yarn add modella-collector
bun add modella-collector
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2014-04-27 |
| First published | 2014-04-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Corticchiato |
| Maintainers | dawicorti |
| Keywords | modella, collection, collectible, collector |

## Links

- npm: https://www.npmjs.com/package/modella-collector
- Repository: https://github.com/dawicorti/modella-collector
- Issues: https://github.com/dawicorti/modella-collector/issues
- npm.io page: https://npm.io/package/modella-collector

## Recent versions

- 0.0.5 (latest) — 2014-04-27
- 0.0.3 — 2014-04-27
- 0.0.2 — 2014-04-27
- 0.0.1 — 2014-04-26

## README

# modella-collector

[modella](http://github.com/modella/modella) plugin to enable collection attributes.

## Usage

```js
var modella = require('modella');
var collector = require('modella-collector');

var Disc = modella('Disc')œ
  .attr('artist', {type: 'string'})
  .attr('name', {type: 'string'});

var Fan = modella('Fan')
  .attr('name', {type: 'string'})
  .attr('discs', {type: [Disc]})
  .use(collector);

var jack = new Fan({
  name: 'Jack',
  discs: [
    {artist: 'The Beatles', name: 'Sgt. Pepper\'s Lonely Hearts Club Band'},
    {artist: 'The Who', name: 'My Generation'}
  ]
});

console.log(jack.discs().first().artist()); // "The Beatles"
```

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