osio-config
v1.0.0
Published
OverSpeed configuration helper.
Downloads
16
Readme
Node OS Config
Example
BOOLEAN: true
STRING: random string
ARRAY:
- string 1
- string 2
- string 3
Number: 1
'use strict';
const {setConfigPath, getConfig, arrayConfig, booleanConfig} = require('../index');
setConfigPath(__dirname);
getConfig('BOOLEAN', booleanConfig);
getConfig('ARRAY', arrayConfig);
getConfig('NUMBER', Number);
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 ...
process.env.NODE_ENV = 'development';
setConfigPath(__dirname); // 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