Created
February 7, 2010 03:46
-
-
Save tim-smart/297196 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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