registrar

Extensible, storage-agnostic object models, backbone-style

npm install registrar
2 downloads in the last week
8 downloads in the last month

registrar

Extensible, storage-agnostic object models, backbone-style.

Example

var Model = require('registrar').Model;

// define a new model
var Person = Model.extend({
  // add your instance methods
  logExample: function() {
    console.log(this.name, 'is', this.age, 'years old.')
  }
});

// create a new instance of that model
var person = new Person({ name: 'Ben', 'age': 29 });

// run the instance method
person.logExample();

// set a value on that instance
person.set('age', 30);

// run the instance method again
person.logExample();
npm loves you