1.0.3 • Published 5 years ago

we-config v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

we-config

This creates a globally configured object based on a series of javascript object files. The files should be in the format: module.exports = {

}

The resulting structure is based on the file structure, where directires are turned into sub objects, as are any dots in a file. So for instance If you have a file in the directory stuff named mine.sub.js and it contained: module.exports = { ref: 'ref1', subRefs: { ref2: 'value' } } it would create the structure: { stuff:{ mine: { sub: { ref: 'ref1', subRefs: { ref2: 'value' } } } } }

#setConfigPath This needs to be called at least once. This sets the configuration path and loads the files into the configuraiton. It will clear any existing configuraiton.

#config While once loaded the configuration be accessed via the global config variable, you can explicitely call it from the included file as well.