Simple module to load a configuration
import twakeConfig from '@twake/config-parser'
const desc = {
value_1: null, // configuration key without default value
value_2: 'val2', // configuration key with default value
}
const optionalConfFile = '/etc/my/conf.json'
const conf = twakeConfig(desc, optionalConfFile)
twakeConfig()
reads optional configuration file if given. Then
it parse environment variables to see if key.toUpperCase()
exists.
If yes, it uses this value for this key, else it uses default value
if exists.
Then it returns the result.
Copyright (c) 2023-present Linagora https://linagora.com
License: GNU AFFERO GENERAL PUBLIC LICENSE