Currently under construction. The goal is to have an API like:
# Import
{PluginEngine} = require('plugin-engine')
# Create Plugin Engine Instance
pluginEngine = new PluginEngine({
# Where to load plugins from?
modulesPaths: [__dirname+'/node_modules']
# Loaded plugins must have this tag in their package.json file
tag: 'docpad-plugin'
# Ensure the plugin supports these engines
engines:
'docpad': '6.22.0'
# Pass these options over to our plugins during instantiation
instantiationOpts:
BasePlugin: require(__dirname+'/out/base-plugin')
}).loadPlugins()
With an example plugin looking like:
module.exports = (instantiationOpts) ->
{BasePlugin} = instantiationOpts
class Plugin extends BasePlugin
Things to still figure out:
- How to handle plugin and parent events
- How to expose the parent object to the plugins
- Priorities for events
You can discover the history inside the History.md
file
Licensed under the incredibly permissive MIT License
Copyright © 2012+ Bevry Pty Ltd
Copyright © 2011 Benjamin Lupton