namespacerjs

0.6.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i namespacerjs

Weekly Downloads

0

Version

0.6.1

License

MIT

Last publish

Collaborators

  • sporto