fixings
v1.2.0
Published
A general-purpose plugin system to add your own plugin system to any project
Downloads
1
Readme
Fixings
the 'g' is silent
1.2.0
Add a plugin system to your project with ease.
Install
npm install --save fixings
const fixings = require('fixings')
// Create a new plugin manager
var Plate = new Fixings()
// Add some plugins
Plate.addPlugin({
name: 'my-plugin',
'hook': function(...) {
// do stuff when called upon
}
})
Plate.addPlugin(require('some-plugin'))
// Create a consumer for a specific hook
var Eater = Plate.resolveHook('hook')
// Loop through the plugins and run them
do {
var plugin = Eater.next()
if (plugin !== null)
plugin.handler(...)
} while (plugin)
For full documentation and tutorials (soon)(tm) see https://drew-s.gitlab.io/fixings