peddamat
5/8/2013 - 9:52 PM

index-handler.js

// Handle a command.
var handler = function(command) {
  if (command) {
    try {
      jqconsole.Write('==> ' + calculator.parse(command) + '\n');
    } catch (e) {
      jqconsole.Write('ERROR: ' + e.message + '\n');
    }
  }
  jqconsole.Prompt(true, handler);
};

// Initiate the first prompt.
handler();