Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created February 7, 2010 03:46
Show Gist options
  • Select an option

  • Save tim-smart/297196 to your computer and use it in GitHub Desktop.

Select an option

Save tim-smart/297196 to your computer and use it in GitHub Desktop.
// An example biggle module / plugin
// __init is called by plugin loader, with the global biggie object as first parameter.
exports.__init = function(big) {
// We can then mix in the global stuff from the biggie object
process.mixin(big.global);
// This will contain all the stuff we want to export as a plugin
var exports = {};
exports.SomePrototype = function() {};
exports.SomePrototype.prototype.method = function() {};
// We can also attach stuff to biggies global object if needed
big.global.MY_FLAG = 1;
big.global.reallyUsefulFunction = function() {};
// We then return our exports
return exports;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment