/plugin-engine

Deprecated. Use https://github.com/bevry/pluginloader

Primary LanguageCoffeeScriptMIT LicenseMIT

Plugin Engine

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:

  1. How to handle plugin and parent events
  2. How to expose the parent object to the plugins
  3. Priorities for events

History

You can discover the history inside the History.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2012+ Bevry Pty Ltd
Copyright © 2011 Benjamin Lupton