Wires Namespace
Micro-library for namespacing objects.
Usage
Namespace
Namespaces are objects that you may add definitions by keypath.
; let namespace = ; namespace; namespace;// >> 'Hello World' namespace;// >> 'Hello World'
add
Add a definition to a namespace, maintaining any existing definitions.
; let locations = ; locations; locations; locationscaliforniasanFrancisco;// >> { type: 'neighborhood', location: 'california.sanFrancisco', soma: {...} } locationscaliforniasanFranciscosoma;// >> { type: 'city', location: 'california' }
get
Safely retrieve a definition by keypath, returning undefined
if definition does not exist.
; let people = ; people; people;// >> 'Programmer' people;// >> undefined
Contibuting
Getting Started
git clone git@github.com:marionette-wires/wires-namespace.git && cd wires-namespace
Make sure Node.js and npm are installed.
npm install
Running Tests
npm test
===
© 2014 James Kyle. Distributed under ISC license.