Skip to content

Instantly share code, notes, and snippets.

@to4iki
Created December 21, 2014 06:24
Show Gist options
  • Save to4iki/ec66eeebc80c86143c75 to your computer and use it in GitHub Desktop.
Save to4iki/ec66eeebc80c86143c75 to your computer and use it in GitHub Desktop.
(function(global) {
"use strict;"
// Class ------------------------------------------------
function YourModule() {
};
// Header -----------------------------------------------
YourModule["prototype"]["method"] = YourModule_method; // YourModule#method(someArg:any):void
// Implementation ---------------------------------------
function YourModule_method(someArg) {
// ...
}
// Exports ----------------------------------------------
if ("process" in global) {
module["exports"] = YourModule;
}
global["YourModule"] = YourModule;
})((this || 0).self || global);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment