Skip to content

Instantly share code, notes, and snippets.

@lean8086
Created May 10, 2012 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lean8086/2654041 to your computer and use it in GitHub Desktop.
Save lean8086/2654041 to your computer and use it in GitHub Desktop.
Namespace template
(function (window) {
"use strict";
/**
* Helpers
*/
var document = window.document,
WebSocket = window.WebSocket,
Worker = window.Worker,
localStorage = window.localStorage,
RegExp = window.RegExp,
setTimeout = window.setTimeout,
setInterval = window.setInterval,
/**
* Core
*/
namespace = {},
/**
* Private properties
*/
foo = "bar";
/**
* Private methods
*/
function bar() {
return foo;
}
/**
* Public members
*/
namespace.foo = "bar";
namespace.bar = function () { };
/**
* Exports
*/
window.namespace = namespace;
}(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment