index.js
function getObjects(user) {
  var username = (_.isObject(user)) ? user.login : user;
  var isOrg = (_.isObject(user) && user.type === 'Organization');
  var defers = [];

  // Get repos
  defers.push(qG({
    obj: 'repos', method: 'getFromUser', user: username,
    sort: 'created', per_page: 100
  }));

  // Get gists
  defers.push(qG({
    obj: 'gists', method: 'getFromUser', user: username,
    sort: 'created', per_page: 100
  }));

  // Get members (for orgs)
  if (isOrg) {
    defers.push(qG({
      obj: 'orgs', method: 'getMembers', org: username,
      per_page: 100
    }));
  }

  return q.all(defers);
}
function getObjects(user) {
  var username = (_.isObject(user)) ? user.login : user;
  var isOrg = (_.isObject(user) && user.type === 'Organization');
  var defers = [];

  // Get repos
  defers.push(qG({
    obj: 'repos', method: 'getFromUser', user: username,
    sort: 'created', per_page: 100
  }));

  // Get gists
  defers.push(qG({
    obj: 'gists', method: 'getFromUser', user: username,
    sort: 'created', per_page: 100
  }));

  // Get members (for orgs)
  if (isOrg) {
    defers.push(qG({
      obj: 'orgs', method: 'getMembers', org: username,
      per_page: 100
    }));
  }

  return q.all(defers);
}
function getObjects ( user ) { var username = ( _ . isObject ( user ) ) ? user . login : user ; var isOrg = ( _ . isObject ( user ) && user . type === 'Organization' ) ; var defers = [ ] ; // Get repos defers . push ( qG ( { obj : 'repos' , method : 'getFromUser' , user : username , sort : 'created' , per_page : 100 } ) ) ; // Get gists defers . push ( qG ( { obj : 'gists' , method : 'getFromUser' , user : username , sort : 'created' , per_page : 100 } ) ) ; // Get members (for orgs) if ( isOrg ) { defers . push ( qG ( { obj : 'orgs' , method : 'getMembers' , org : username , per_page : 100 } ) ) ; } return q . all ( defers ) ; }
Get objects for a specific username
Get objects for a specific username