Skip to content
This repository has been archived by the owner on Sep 13, 2018. It is now read-only.

sporto/namespacer.js

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Namespacer.js

A simple library for creating namespaces in the browser

	// Create the namespace
	Namespacer('foo.bar.baz')

	// Use the namespace
	foo.bar.baz = {
		a: 1
	}

	// Pass an object directly
	Namespacer('foo.bar.baz', {
		a: 1
	})''

	// Retrieve an object from a namespace, if it doesn't exist it will just return an empty object
	var a = Namespacer('foo.bar.baz');

Namespacer takes care of not replacing existing objects.

Install

npm install namespacerjs

Test

webpack
Open test/index.html in a browser

or

npm test

Build

npm install
webpack

About

namespacer.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published