@brightcove-gs/odyssey-config
v1.0.0
Published
Application configuration variables for Odyssey node app
Downloads
58
Readme
Odyssey Config
A configuration manager utilizing nconf
Install
yarn add @brightcove-gs/odyssey-config
Usage
const Config = require('@brightcove-gs/odyssey-config')
const defaults = {
WWW_URL: 'https://www.example.com',
IS_AWESOME: true,
SCORE: 100,
COLORS: ['red', 'green', 'blue'],
}
const config = Config(defaults)
config.get('IS_AWESOME') // => true
NOTES
Precedence
- Environment Variables trump all
.env.json
in the root directory takes second- Passed in
defaults
object
Casting
All values should have a default in the type they expect to be. For example, if you use a variable string
WWW_URL = 'https://www.example.com'
. You should declare a default value so it knows how to handle incoming environment variables.