es6-namespace
v0.1.0
Published
A lightweight javascript helper checking for or creating namespace objects.
Downloads
5
Readme
es6-namespace
es6-namespace is a lightweight javascript helper checking for or creating namespace objects. Is compatible with all new and old browsers like IE6.
Usage
You can create a object chain with
Namespace.create('be.awesome').Magic = function() {
// your magic code
};
Check if a namespace exists
Namespace.has('be.awesome');
Check if namespace on a local object exists
var localObj = { be: { awesome: 'bam' } };
if (Namespace.has(localObj, 'be.awesome')) {
Namespace.create('be.awesome');
}