var chalk = require('chalk');
var readline = require('readline');
var sprintf = require('sprintf-js').sprintf;

function timestamp() {
  return chalk.dim('[' + new Date().toLocaleString() + ']');
}

function print(style) {
  var message = sprintf.apply(null, Array.prototype.slice.call(arguments, 1));
  if (style) {
    message = style(message);
  }

  console.log(timestamp() + ' ' + message);
}

module.exports = {
  info: print.bind(null, null),
  h1: print.bind(null, chalk.bold.green),
  h2: print.bind(null, chalk.cyan),
  h3: print.bind(null, chalk.yellow),
  warn: print.bind(null, chalk.red),

  error: function() {
    console.log(chalk.bold.red(sprintf.apply(null, arguments)));
  },

  question: function(text, callback) {
    var rl = readline.createInterface(process.stdin, process.stdout);
    rl.question(chalk.green('?') + ' ' + text + ' ', function(answer) {
      rl.close();
      callback(answer);
    });
  },
};

@@ -19,24 +19,46 @@
 e('chalk');%0A
+var Q = require('q');%0A
 var readline
@@ -741,22 +741,12 @@
 text
-, callback
 ) %7B%0A
+
     
@@ -811,16 +811,46 @@
 tdout);%0A
+    var deferred = Q.defer();%0A
     rl.q
@@ -941,32 +941,69 @@
     
-callback(answer);%0A    %7D)
+deferred.resolve(answer);%0A    %7D);%0A    return deferred.promise
 ;%0A  

Convert question to promise interface