code: function reduceByDepth(depthTree) {
      var order = 0
        , handled = {}
        , useInOrder = []
        ;
  
      // it's important to sort and reverse the key listing so that 
      // the most deeply depended on modules are always installed first and listed first in ender.js
      Object.keys(depthTree).sort().reverse().forEach(function (depth) {
        var depNames = depthTree[depth]
          ;
  
        depNames.forEach(function (depName) {
          if (!handled[depName]) {
            handled[depName] = true;
            useInOrder.push(depName);
          }
        });
  
      });
  
      return useInOrder;
    }
docs: And then you can reduce that result into a simple 1-dimentional list like so: