summaryrefslogtreecommitdiffstats
path: root/lib/plugins/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/index.js')
-rw-r--r--lib/plugins/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/plugins/index.js b/lib/plugins/index.js
index 6eb788b..343c569 100644
--- a/lib/plugins/index.js
+++ b/lib/plugins/index.js
@@ -95,7 +95,13 @@ PluginsManager.prototype.install = function() {
return registry.install(that.book, plugin.name, plugin.version);
})
.thenResolve(plugins.length);
+};
+// Call a hook on all plugins to transform an input
+PluginsManager.prototype.hook = function(name, input) {
+ return Promise.reduce(this.plugins, function(current, plugin) {
+ return plugin.hook(name, current);
+ }, input);
};
module.exports = PluginsManager;