var nconf = require('nconf')
  , path = require('path');

const defaults = {
    username: "",
    password: "",
    guardcode: "",
    twofactor: "",
    sentryauth: false,
    sentryfile: "",
    autojoin: [],
    "24hour": false,
    userlistwidth: 26,                  // 26 characters
    scrollback: 1000,                   // 1000 lines
    ghostcheck: 5*60*1000,              // 5 minutes
    max_reconnect: 5,                   // 5 attempts
    reconnect_timeout: 30*1000,         // 30 seconds
    reconnect_long_timeout: 10*60*1000  // 10 minutes
};

function setPath(configPath) {
    nconf.file(configPath);
    nconf.stores.file.store = 
        Object.assign({}, defaults, nconf.stores.file.store);
}

setPath(path.join(__dirname, '..', 'config.json'));

module.exports = {
    set: (...args) => nconf.set(...args),
    get: (...args) => nconf.get(...args),
    save: (...args) => nconf.save(...args),
    reload: (...args) => nconf.load(...args),
    getPath: () => nconf.stores.file.file,
    setPath,
    isValidKey: (key) => Object.keys(defaults).includes(key)
};

@@ -560,216 +560,8 @@
 %7D;%0A%0A
-function setPath(configPath) %7B%0A    nconf.file(configPath);%0A    nconf.stores.file.store = %0A        Object.assign(%7B%7D, defaults, nconf.stores.file.store);%0A%7D%0A%0AsetPath(path.join(__dirname, '..', 'config.json'));%0A%0A
 modu
@@ -807,70 +807,402 @@
 Path
-,%0A    isValidKey: (key) =%3E Object.keys(defaults).includes(key)%0A%7D
+: (configPath) =%3E %7B%0A        nconf.file(configPath);%0A        nconf.stores.file.store = %0A            Object.assign(%7B%7D, defaults, nconf.stores.file.store);%0A    %7D,%0A    isValidKey: (key) =%3E Object.keys(defaults).includes(key),%0A    checkType: (key) =%3E module.exports.isValidKey(key) %0A                        && typeof(defaults%5Bkey%5D)%0A%7D;%0A%0Amodule.exports.setPath(path.join(__dirname, '..', 'config.json'))
 ;%0A

Add checkType method and prettify code