Static Variables
Static variables allows for storing global variables including submodules.
Installation
npm install static-vars --save
Usage
index.js
var staticVars = ;var myVar = staticVars;
other.js
var staticVars = ;if staticVars console; // 'hello world'
Methods
get (String name [, Mixed def]) : Mixed
Gets the stored value of a static variable, if the variable is not defined then def will be returned.
set (String name, Mixed value) : Object
Sets the value of a static variable, and returns the static-vars object.
has (String name) : Boolean
Determines if a static variable has been defined.
del (String name) : Object
Deletes the static variable, and returns the static-vars object.
Development and testing
Mocha unit tests:
npm test
ESLint and JSHint:
npm run eslintnpm run jshint