index.js
function get(usernames, options) {
  usernames = usernames || '';
  usernames = (_.isArray(usernames)) ? usernames : usernames.split(',');
  options = options || {};
  var defers = [];
  var collection = {};

  _.each(usernames, function(u) {
    var defer = q.defer();
    u = u.toLowerCase();

    if (u.length === 0) {
      return;
    }

    qG({
      obj: 'user', method: 'getFrom', user: u
    })
    .done(function(data) {
      collection[u] = data[0];

      // Get objects for the specific user
      getObjects(data[0]).done(function(objData) {
        collection[u].objects = collection[u].objects || {};
        collection[u].objects.repos = objData[0];
        collection[u].objects.gists = objData[1];
        collection[u].objects.members = objData[2];

        defer.resolve(collection[u]);
      });
    });

    defers.push(defer.promise);
  });

  return q.all(defers).then(function() {
    return collection;
  });
}
function get(usernames, options) {
  usernames = usernames || '';
  usernames = (_.isArray(usernames)) ? usernames : usernames.split(',');
  options = options || {};
  var defers = [];
  var collection = {};

  _.each(usernames, function(u) {
    var defer = q.defer();
    u = u.toLowerCase();

    if (u.length === 0) {
      return;
    }

    qG({
      obj: 'user', method: 'getFrom', user: u
    })
    .done(function(data) {
      collection[u] = data[0];

      // Get objects for the specific user
      getObjects(data[0]).done(function(objData) {
        collection[u].objects = collection[u].objects || {};
        collection[u].objects.repos = objData[0];
        collection[u].objects.gists = objData[1];
        collection[u].objects.members = objData[2];

        defer.resolve(collection[u]);
      });
    });

    defers.push(defer.promise);
  });

  return q.all(defers).then(function() {
    return collection;
  });
}
function get ( usernames , options ) { usernames = usernames || '' ; usernames = ( _ . isArray ( usernames ) ) ? usernames : usernames . split ( ',' ) ; options = options || { } ; var defers = [ ] ; var collection = { } ; _ . each ( usernames , function ( u ) { var defer = q . defer ( ) ; u = u . toLowerCase ( ) ; if ( u . length === 0 ) { return ; } qG ( { obj : 'user' , method : 'getFrom' , user : u } ) . done ( function ( data ) { collection [ u ] = data [ 0 ] ; // Get objects for the specific user getObjects ( data [ 0 ] ) . done ( function ( objData ) { collection [ u ] . objects = collection [ u ] . objects || { } ; collection [ u ] . objects . repos = objData [ 0 ] ; collection [ u ] . objects . gists = objData [ 1 ] ; collection [ u ] . objects . members = objData [ 2 ] ; defer . resolve ( collection [ u ] ) ; } ) ; } ) ; defers . push ( defer . promise ) ; } ) ; return q . all ( defers ) . then ( function ( ) { return collection ; } ) ; }
Get data from usernames, which can be an array of usernames or a string of usernames separated by commas.
Get data from usernames which can be an array of usernames or a string of usernames separated by commas .