var filesystem = require('fs');
var config = { baseUrl: 'https://metrics-api.librato.com/v1/' };
try {
  config = JSON.parse(filesystem.readFileSync('config.json'));
} catch (err) {
}

var saveConfig = function() {
  var configContents = JSON.stringify(config, null, 2);
  filesystem.writeFileSync('config.json', configContents);
};

var setToken = function(token) {
  config.libratoToken = token;
  saveConfig();
};

var setApiKey = function(apiKey) {
  config.libratoApiKey = apiKey;
  saveConfig();
};

module.exports = config;
module.exports.setToken = setToken;
module.exports.setApiKey = setApiKey;

@@ -134,33 +134,49 @@
 em.readFileSync(
-'
+__dirname + '/../
 config.json'));%0A
@@ -191,16 +191,99 @@
 (err) %7B%0A
+  console.error('Could not read config file at ' + __dirname + '/../config.json');%0A
 %7D%0A%0Avar s

Fix relative pathing of config file.