index.js
function processDeps(queue, collection, callback, errBack) {
  return errTo(errBack, function(packages) {
    var deps;

    packages.forEach(function(pkg) {
      // add the package to the collection of processed packages
      addPackage(collection, pkg);

      // if the module has dependencies, add them to the processing queue
      // unless they have been already processed
      mapDependencies(pkg.dependencies).forEach(function(dep) {
        if (!isDuplicate(collection[dep.name], dep.version)) {
          addToQueue(queue, dep);
        }
      });
    });

    callback(queue);
  });
}
function processDeps(queue, collection, callback, errBack) {
  return errTo(errBack, function(packages) {
    var deps;

    packages.forEach(function(pkg) {
      // add the package to the collection of processed packages
      addPackage(collection, pkg);

      // if the module has dependencies, add them to the processing queue
      // unless they have been already processed
      mapDependencies(pkg.dependencies).forEach(function(dep) {
        if (!isDuplicate(collection[dep.name], dep.version)) {
          addToQueue(queue, dep);
        }
      });
    });

    callback(queue);
  });
}
function processDeps ( queue , collection , callback , errBack ) { return errTo ( errBack , function ( packages ) { var deps ; packages . forEach ( function ( pkg ) { // add the package to the collection of processed packages addPackage ( collection , pkg ) ; // if the module has dependencies, add them to the processing queue // unless they have been already processed mapDependencies ( pkg . dependencies ) . forEach ( function ( dep ) { if ( ! isDuplicate ( collection [ dep . name ] , dep . version ) ) { addToQueue ( queue , dep ) ; } } ) ; } ) ; callback ( queue ) ; } ) ; }
Add the packages to the "results" collection and add their direct
dependencies to the `queue` so they can be processed later. When all done,
invoke callback.

@param {Object} queue
@param {Object} collection
@param {Function} callback
Add the packages to the results collection and add their direct dependencies to the queue so they can be processed later . When all done invoke callback .