Skip to content

Instantly share code, notes, and snippets.

Created Jul 12, 2010
What would you like to do?
(function(global) {
var config = false,
modules = [];
// setup single public namespace
var skel = global.skel = {
init: function(c) {
// put initial config in the public scope
config = c;
for(var i = 0; i < modules.length; i++) {
register: function(module) {
if(! {
throw new Error("Modules must provide at minimal a run() function");
if(module.register) {
(function(skel) {
name: "skeleton",
run: function(config) {
// do some stuff
var x = 1;
return x;

This comment has been minimized.

Copy link
Owner Author

@morganrallen morganrallen commented Jul 12, 2010

In this situation, run.js would be the last in the build.xml concatanation and gets this started. Modules register themselves if they need to do anything at runtime. init() then runs each of the modules after initing itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment