code: function(location) {
    var found = false;
  
    while(!found) {
      if (exists(location + '/package.json')) {
        found = location;
      } else if (location !== '/') {
        location = path.dirname(location);
      } else {
        return false;
      }
    }
  
    return location;
  }
docs: Find the location of a package.json file near or above the given location