Node OS Config
Example
BOOLEAN: trueSTRING: random stringARRAY: - string 1 - string 2 - string 3Number: 1
'use strict'; const setConfigPath getConfig arrayConfig booleanConfig = ; ; ;;;
Priority
Highest -> Lowest
- .env file
- process enviorment
- specified configuration file when using
setConfigPath()
method
Loading Config Files
Config files are currently loaded based on NODE_ENV=<env-name>
. See below example ...
processenvNODE_ENV = 'development';; // Loads __dirname/development.yml
TODO
- Add circle ci support
- Better documentation
- Add cli arguments support
- Add support for addtional configuration file extensions other than
.yml