index.js
function getBulkNpmData(pkgs, collection, npmClient, callback) {
  var next, results;

  results = [];
  next    = after(pkgs.length, function(err) {
    return callback(err, results);
  });

  pkgs.forEach(function(pkg) {
    // make sure not to make unnecessary queries to the registry
    if (isDuplicate(collection[pkg.name], pkg.version)) {
      return next(null);
    }

    getNpmData(pkg, npmClient, errTo(callback, function(found) {
      if (found) { results.push(found); }

      next(null, results);
    }));
  });
}
function getBulkNpmData(pkgs, collection, npmClient, callback) {
  var next, results;

  results = [];
  next    = after(pkgs.length, function(err) {
    return callback(err, results);
  });

  pkgs.forEach(function(pkg) {
    // make sure not to make unnecessary queries to the registry
    if (isDuplicate(collection[pkg.name], pkg.version)) {
      return next(null);
    }

    getNpmData(pkg, npmClient, errTo(callback, function(found) {
      if (found) { results.push(found); }

      next(null, results);
    }));
  });
}
function getBulkNpmData ( pkgs , collection , npmClient , callback ) { var next , results ; results = [ ] ; next = after ( pkgs . length , function ( err ) { return callback ( err , results ) ; } ) ; pkgs . forEach ( function ( pkg ) { // make sure not to make unnecessary queries to the registry if ( isDuplicate ( collection [ pkg . name ] , pkg . version ) ) { return next ( null ) ; } getNpmData ( pkg , npmClient , errTo ( callback , function ( found ) { if ( found ) { results . push ( found ) ; } next ( null , results ) ; } ) ) ; } ) ; }
Fetches data from the NPM registry for all the packages provided.

@param {Array} pkgs - an array of packages objects containing the name && version props
@param {Object} collection - collection of processed packages
@param {Object} npmClient - instance of npm-registry-client
@param {Function} callback
Fetches data from the NPM registry for all the packages provided .