plugo
v0.4.0
Published
Dynamically expose hapi plugins from a given path
Downloads
18
Readme
plugo
Dynamically expose modules to hapi plugins from a given path.
Usage
const Plugo = require('plugo');
exports.register = (plugin, options, next) => {
var plugoptions = {
name: 'handlers',
path: __dirname + '/handlers'
};
// Exposes modules in the handlers folder to this plugin
Plugo.expose(plugoptions, plugin, next);
};
exports.register.attributes = {
name: 'controllers'
};
Options
The following options are available:
name
: Defines property name under plugin [required
]path
: Specifies which folder to load files [required
]extension
: Specifies which file extension to look for (defaults to .js) [optional
]