index.js
function qG(options) {
  var defer = q.defer();
  var compiledData = [];

  // Recursive call to paginate
  function qGCall(pageLink) {
    var methodCall;

    // Callback
    function callback(error, data) {
      if (error) {
        defer.reject(new Error(error));
      }
      else {
        compiledData = compiledData.concat(data);
        if (github.hasNextPage(data)) {
          qGCall(data);
        }
        else {
          defer.resolve(compiledData);
        }
      }
    }

    // If the call is a link to another page, use that.
    if (pageLink) {
      method = github.getNextPage(pageLink, callback);
    }
    else {
      githubAuth()[options.obj][options.method](options, callback);
    }
  }
  qGCall();

  return defer.promise;
}
function qG(options) {
  var defer = q.defer();
  var compiledData = [];

  // Recursive call to paginate
  function qGCall(pageLink) {
    var methodCall;

    // Callback
    function callback(error, data) {
      if (error) {
        defer.reject(new Error(error));
      }
      else {
        compiledData = compiledData.concat(data);
        if (github.hasNextPage(data)) {
          qGCall(data);
        }
        else {
          defer.resolve(compiledData);
        }
      }
    }

    // If the call is a link to another page, use that.
    if (pageLink) {
      method = github.getNextPage(pageLink, callback);
    }
    else {
      githubAuth()[options.obj][options.method](options, callback);
    }
  }
  qGCall();

  return defer.promise;
}
function qG ( options ) { var defer = q . defer ( ) ; var compiledData = [ ] ; // Recursive call to paginate function qGCall ( pageLink ) { var methodCall ; // Callback function callback ( error , data ) { if ( error ) { defer . reject ( new Error ( error ) ) ; } else { compiledData = compiledData . concat ( data ) ; if ( github . hasNextPage ( data ) ) { qGCall ( data ) ; } else { defer . resolve ( compiledData ) ; } } } // If the call is a link to another page, use that. if ( pageLink ) { method = github . getNextPage ( pageLink , callback ) ; } else { githubAuth ( ) [ options . obj ] [ options . method ] ( options , callback ) ; } } qGCall ( ) ; return defer . promise ; }
Wrap github calls in to promises
Wrap github calls in to promises