diff --git a/core/lib/plugin_manager.js b/core/lib/plugin_manager.js index fdb331a5b..bafe3a2a4 100644 --- a/core/lib/plugin_manager.js +++ b/core/lib/plugin_manager.js @@ -5,10 +5,21 @@ var plugin_manager = function (config, configPath) { fs = require('fs-extra'), util = require('./utilities'); + /** + * Loads a plugin + * + * @param pluginName {string} the name of the plugin + * @return {object} the loaded plugin + */ function loadPlugin(pluginName) { return require(path.join(process.cwd(), 'node_modules', pluginName)); } + /** + * Installs a plugin + * + * @param pluginName {string} the name of the plugin + */ function installPlugin(pluginName) { try { var pluginPath = path.resolve( @@ -40,6 +51,11 @@ var plugin_manager = function (config, configPath) { } } + /** + * Detect installed plugins + * + * @return {array} list of installed plugins + */ function detectPlugins() { var node_modules_path = path.join(process.cwd(), 'node_modules'); return fs.readdirSync(node_modules_path).filter(function (dir) { @@ -48,10 +64,18 @@ var plugin_manager = function (config, configPath) { }); } + /** + * Disables an installed plugin + * Not implemented yet + */ function disablePlugin(pluginName) { console.log('disablePlugin not implemented yet. No change made to state of plugin', pluginName); } + /** + * Enables an installed plugin + * Not implemented yet + */ function enablePlugin(pluginName) { console.log('enablePlugin not implemented yet. No change made to state of plugin', pluginName); }