meteor-namespace
A simple javascript namespacing utility that allows the easy creation of global namespaces.
This package functions by creating the namespace and attaching it to GLOBAL
if it's on the server
or window
if it's on the client. Now on NPM!
Installation
Node
npm install meteor-namespace
Meteor
meteor add zephraph:namespace
Usage
To use this with node add a require like normal:
var Namespace = ;
Calling the Namespace function creates a global namespace and returns the namespace to be edited
test = 'hello world';console; // Prints out 'hello world'
When passing in a function 'this' is bound to the specified namespace
;console; // Prints out 'hello again!'
If passing in a object literal the key/value pairs will be added to the namespace
;console; // Prints out 'goodbye!'
Meteor Only
A namespace can be limited to the client or server by calling Namespace.server
or Namespace.client
Namespace;