Skip to content
namespacer.js
JavaScript CSS HTML
Find file
Latest commit d0e8b3e @sporto 0.6.1
Failed to load latest commit information.
dist Webpack UMD
src Webpack UMD
test Webpack UMD
.gitignore 0.5 Fixed clobbering of global variables
.jshintrc 0.5 Fixed clobbering of global variables
gulpfile.js Webpack UMD
npm-debug.log Webpack UMD
package.json 0.6.1
readme.md Webpack UMD
webpack.config.js Webpack UMD

readme.md

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
Something went wrong with that request. Please try again.