async validatePluginDirectory(pluginPath) {
    const pluginConfFileName = "config.json";
    const isConfFileExists = await fs.exists(
      path.join(pluginPath, pluginConfFileName)
    );
    if (!isConfFileExists) {
      throw `Invalid plugin dir: No ${pluginConfFileName} file (${pluginPath})`;
    }

    let pluginConf;
    try {
      pluginConf = require(path.join(pluginPath, pluginConfFileName));
    } catch (err) {
      throw `Error parsing ${pluginConfFileName}: ${err.message} (${pluginPath})`;
    }

    if (!pluginConf.name) {
      throw `Invalid ${pluginConfFileName}: plugin name missing (${pluginPath})`;
    }

    return pluginConf;
  }
/**
   * validates the plugin directory and returns the parsed plugin config.
   * @param {string} pluginPath
   * @returns {Object}
   */
validates the plugin directory and returns the parsed plugin config.
@param {string} pluginPath
@returns {Object}
validates the plugin directory and returns the parsed plugin config . @param { string } pluginPath @returns { Object }
async validatePluginDirectory(pluginPath) {
    const pluginConfFileName = "config.json";
    const isConfFileExists = await fs.exists(
      path.join(pluginPath, pluginConfFileName)
    );
    if (!isConfFileExists) {
      throw `Invalid plugin dir: No ${pluginConfFileName} file (${pluginPath})`;
    }
    let pluginConf;
    try {
      pluginConf = require(path.join(pluginPath, pluginConfFileName));
    } catch (err) {
      throw `Error parsing ${pluginConfFileName}: ${err.message} (${pluginPath})`;
    }
    if (!pluginConf.name) {
      throw `Invalid ${pluginConfFileName}: plugin name missing (${pluginPath})`;
    }
    return pluginConf;
  }
async validatePluginDirectory ( pluginPath ) { const pluginConfFileName = "config.json" ; const isConfFileExists = await fs . exists ( path . join ( pluginPath , pluginConfFileName ) ) ; if ( ! isConfFileExists ) { throw ` ${ pluginConfFileName } ${ pluginPath } ` ; } let pluginConf ; try { pluginConf = require ( path . join ( pluginPath , pluginConfFileName ) ) ; } catch ( err ) { throw ` ${ pluginConfFileName } ${ err . message } ${ pluginPath } ` ; } if ( ! pluginConf . name ) { throw ` ${ pluginConfFileName } ${ pluginPath } ` ; } return pluginConf ; }
validates the plugin directory and returns the parsed plugin config.
validates the plugin directory and returns the parsed plugin config .