code: function findParentDirectory(currentFullPath, filename) {
    const root = path.parse(currentFullPath).root;
    const testDir = (parts) => {
      if (parts.length === 0) {
        return null;
      }
  
      const fullPath = path.join(root, parts.join(path.sep));
  
      var exists = fs.existsSync(path.join(fullPath, filename));
      return exists ? fullPath : testDir(parts.slice(0, -1));
    };
  
    return testDir(currentFullPath.substring(root.length).split(path.sep));
  }
docs: Finds the most near ancestor starting at `currentFullPath` that has a file named `filename`