var nconf = require('nconf');

var scheConf = new nconf.Provider();
var mainConf = new nconf.Provider();
var optConf = new nconf.Provider();
var name2Conf = {"sche" : scheConf, "main": mainConf, "opt": optConf};

scheConf.file({file: './app/schedules.json'});
mainConf.file({file: './app/schools.json'});
optConf.file({file: './app/options.json'});

function saveSettings(settingKey, settingValue, file) {
    var conf = name2Conf[file];
    conf.set(settingKey, settingValue);
    conf.save();
}

function readSettings(settingKey, file) {
    var conf = name2Conf[file];
    conf.load();
    return conf.get(settingKey);
}

function getSettings(file) {
    var conf = name2Conf[file];
    conf.load();
    return conf.get();
}

function clearSetting(key, file) {
    var conf = name2Conf[file];
    conf.load();
    conf.clear(key);
    conf.save();
}

module.exports = {
    saveSettings: saveSettings,
    readSettings: readSettings,
    getSettings: getSettings,
    clearSetting: clearSetting
};

@@ -206,16 +206,17 @@
 Conf%7D;%0A%0A
+%0A
 scheConf
@@ -220,34 +220,45 @@
 onf.file(%7Bfile: 
+__dirname + 
 '
-.
 /app/schedules.j
@@ -282,26 +282,37 @@
 file(%7Bfile: 
+__dirname + 
 '
-.
 /app/schools
@@ -345,10 +345,21 @@
 le: 
+__dirname + 
 '
-.
 /app

Make .json config paths relative