code: function closestParentImporting(location, packageName) {
      const candidate = path.resolve(location, './package.json');
  
      try {
          const packageDefinition = JSON.parse(fs.readFileSync(candidate, 'utf-8'));
          const dependencies = packageDefinition.dependencies;
          const devDependencies = packageDefinition.devDependencies;
  
          if (dependencies && dependencies[packageName]) {
              return location;
          } else if (devDependencies && devDependencies[packageName]) {
              return location;
          }
      } catch (err) {
          // No luck here, continue on
      }
  
      // Check if we have reached the top
      if (location === path.resolve(location, '..')) {
          return location;
      }
  
      // Go further up the chain
      return closestParentImporting(path.resolve(location, '..'), packageName);
  }
docs: Helper function for locating the closest parent directory containing
  a package.json that lists given package as a (dev) dependency.
  
  @param location - Starting location for search
  @param packageName - name of the package we are searching for
  
  @returns location that we think is closest, which might end up being
  the root directory of the running environment (if no matches were found)