index.js
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;
}
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;
}
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 ; }
Find the location of a package.json file near or above the given location
Find the location of a package . json file near or above the given location