index.js
function remoteAsync() {
  var generator = this.generator;
  
  var username;
  var repo;
  var branch;
  var refresh;
  var url;

  // With URL and refresh
  if (arguments.length <= 2) {
    url = arguments[0];
    refresh = arguments[1];
  } else {
    username = arguments[0];
    repo = arguments[1];
    branch = arguments[2];
    refresh = arguments[3];
    url = 'https://github.com/' + [username, repo, 'archive', branch].join('/') + '.tar.gz';
  }
  
  return new Promise(function(resolve, reject) {
    parent.remote.call(parent, url, function(err, remote) {
      if (err) {
        reject(err);
      }
      else {
        resolve(remote);
      }
    }, refresh);
  });
}
function remoteAsync() {
  var generator = this.generator;
  
  var username;
  var repo;
  var branch;
  var refresh;
  var url;

  // With URL and refresh
  if (arguments.length <= 2) {
    url = arguments[0];
    refresh = arguments[1];
  } else {
    username = arguments[0];
    repo = arguments[1];
    branch = arguments[2];
    refresh = arguments[3];
    url = 'https://github.com/' + [username, repo, 'archive', branch].join('/') + '.tar.gz';
  }
  
  return new Promise(function(resolve, reject) {
    parent.remote.call(parent, url, function(err, remote) {
      if (err) {
        reject(err);
      }
      else {
        resolve(remote);
      }
    }, refresh);
  });
}
function remoteAsync ( ) { var generator = this . generator ; var username ; var repo ; var branch ; var refresh ; var url ; // With URL and refresh if ( arguments . length <= 2 ) { url = arguments [ 0 ] ; refresh = arguments [ 1 ] ; } else { username = arguments [ 0 ] ; repo = arguments [ 1 ] ; branch = arguments [ 2 ] ; refresh = arguments [ 3 ] ; url = 'https://github.com/' + [ username , repo , 'archive' , branch ] . join ( '/' ) + '.tar.gz' ; } return new Promise ( function ( resolve , reject ) { parent . remote . call ( parent , url , function ( err , remote ) { if ( err ) { reject ( err ) ; } else { resolve ( remote ) ; } } , refresh ) ; } ) ; }
Asynchronous remote function that returns a Promise

@returns {Promise}
Asynchronous remote function that returns a Promise