var core = require("./core");
var prompt = require("prompt-sync")();
var fs = require("fs");

var env = process.env.NODE_ENV || "development";

module.exports = function(filepath, password) {
  var out = fs.readFileSync(filepath).toString();
  var json = JSON.parse(out);

  if(!password) {
    if(env === "development") {
      password = prompt("Passpharse to decrypt config: ", {echo: "*"});
    } else {
      throw "No password to decrypt config"
    }
  }
  return core.decrypt(json, password, true);
}

@@ -49,22 +49,21 @@
 re(%22
-prompt-sync%22)(
+./bin/prompt%22
 );%0Av
@@ -377,19 +377,16 @@
  %22, 
-%7Becho: %22*%22%7D
+filepath
 );%0A 

Fix for js API to store in key chain