Skip to content

Instantly share code, notes, and snippets.

@nlf
Created March 13, 2015 18:13
Show Gist options
  • Save nlf/52b513eec3b2b4796d45 to your computer and use it in GitHub Desktop.
Save nlf/52b513eec3b2b4796d45 to your computer and use it in GitHub Desktop.
var Plugin = function (model, options) {
// do something with options
model.extend({ factoryMethod: function () { /* do stuff */ }});
model.prototype.extend({ instanceMethod: function () { /* do other stuff */ }});
model.extendSchema(Joi.object({ some: 'field' }));
};
var Plugin = function (model, options) {
// do your startup crap here
model.factoryMethod = function () { /* do stuff */ };
model.prototype.instanceMethod = function () { /* do other stuff */ };
model.schema = Joi.object({ some: 'field' });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment