const config = require('config'); const configuration = { plex: { url: null, token: null }, scrobble: { percent: null, duration: null }, web: { host: null, port: null } }; if (config.has("plex.url")) configuration.plex.url = config.get("plex.url"); if (config.has("plex.token")) configuration.plex.token = config.get("plex.token"); if (config.has("scrobble.duration")) configuration.scrobble.duration = config.get("scrobble.duration"); if (config.has("scrobble.percent")) configuration.scrobble.percent = config.get("scrobble.percent"); if (config.has("web.host")) configuration.web.host = config.get("web.host"); if (config.has("web.port")) configuration.web.port = config.get("web.port"); module.exports = configuration;