moontils-config
v1.0.1
Published
Easily manage configuration values for an application
Downloads
14
Readme
Moontils Config
Easily manage configuration values for an application.
How to use it
Install the npm package : npm install --save moontils-config
Import it into your code :
import Config from 'moontils-config'
const my_config = new Config(process.env.CONFIG_PATH || '.config');
my_config.setData('test', "Hello man!"); // Will store the value into the file
my_config.getData('test'); // Return the value
my_config.getData('env_variable', 'test'); // Return the ENV_VARIABLE from config, if not found,
// from env and at least return the default value