@cyberblast/config
v0.0.9
Published
A simple json config file loader for node
Readme
cyberblast config
A simple config file loader for node
Usage
using async
const Config = require('@cyberblast/config');
async function run(){
const config = new Config('./yourFile.json');
const settings = await config.load();
// do something with settings object
console.log(settings.greet);
// or like that
console.log(config.settings.greet);
}
run();without async
const Config = require('@cyberblast/config');
const config = new Config('./yourFile.json');
config.load().then(settings => {
// do something with settings object
console.log(settings.greet);
// or like that
console.log(config.settings.greet);
});Imaginary config file ./yourFile.json used in sample above:
{
"greet": "Hello World"
}Legal
Please take note of files LICENSE and CONTRIBUTING.
