code: function isModuleDirectory(filePath) {
    try {
      const manifestPath = path.join(filePath, MANIFEST);
      if (fs.statSync(manifestPath).isFile()) {
        const module = require(manifestPath);
        return module && module.main;
      }
    } catch (error) {}
  }
docs: get only subdirectories that contain package.json with 'main' property