A basic JavaScript collection.
Server-side (Node.js):
$ npm install shannonmoeller/collection.js
Client-side (component(1)):
$ component install shannonmoeller/collection.js
Create a new model which wraps around object
.
var Collection = require('collection');
var foo = Collection([{ a: 1 }, { a: 2 }, { a: 3 }]);
Returns the current state of the internal data as a plain object.
var foo = Collection([{ a: 1 }, { a: 2 }, { a: 3 }]);
foo.toJSON(); // [{ a: 1 }, { a: 2 }, { a: 3 }]
MIT