fileconfig (v-3.0.0)
Library for configuration file loading
install it
npm install fileconfig -g
use it
assuming you have a configuration folder as follow:
+ /path/to/config/folder
+ share
default.yml -> symlink to dev/alpha.yml
+ qa
+ dev
alpha.yml
with this content
name: "alpha dev share"
port: 9090
dir: ${env.ALPHA_SHARE}
then you can fetch data as follow:
var FileConfig = require('fileconfig');
var config = new FileConfig('/path/to/config/folder');
var defaultServer = config.share.default;
console.log(defaultServer.name);
console.log(defaultServer.port);
licence
Apache-2.0