Jet Another simple json configuration package for your projects.
const config = require('yajsonfig')(__dirname + '/config.json');
console.log('My configuration is ', config);
Not many.
You can overwrite the values of the json file based on environment variables.
For example, given the following json file:
{
"port": 3000,
"directory": "/tmp/var"
}
Setup the environment variable SIMPLECONFIG
to a prefix of your choice:
export SIMPLECONFIG='MY_PROJECT_'
And then setup as many variables as you want:
export MY_PROJECT_DIRECTORY=/tmp/another
Your config object will come like:
{
"port": 3000,
"directory": "/tmp/another"
}