docs: function getDepChain(pkg, opts, callback) {
    var pkgs, queue, npmClient;
  
    if (!callback) {
      callback = opts;
      opts = {};
    }
  
    callback  = once(callback);
    pkgs      = {};
    queue     = util.isArray(pkg) ? pkg : [pkg];
    npmClient = opts.npmClient || defaultNpmClient;
  
    (function iterate(queue) {
      var iterator;
  
      if (queue.length) {
        // copy the items in the queue and then reset it
        iterator = queue;
        queue = [];
      } else {
        // if the queue is empty it means we've processed everything
        return callback(null, pkgs);
      }
  
      if (opts.filter) {
        filterPackages(iterator, opts.filter, errTo(callback, function(filteredPkgs) {
          getBulkNpmData(filteredPkgs, pkgs, npmClient, processDeps(queue, pkgs, iterate, callback));
        }));
      } else {
        getBulkNpmData(iterator, pkgs, npmClient, processDeps(queue, pkgs, iterate, callback));
      }
  
    }(queue));
  }