Skip to content

bevry-archive/plugin-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published