Package Exports
- plugiator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (plugiator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
plugiator
A hapi plugins creator
How to install it?
npm install --save plugiatorUsage
plugiator.create(attributes, register)
Creates a plugin with the passed in attributes and register function.
const plugiator = require('plugiator')
function register(server, opts, next) {
server.decorate('server', 'foo', 'bar')
next()
}
module.exports = plugiator.create({
name: 'foo',
version: '1.0.0',
}, register)
// or set just the name
module.exports = plugiator.create('foo', register)plugiator.anonymous(register)
Creates a plugin with the passed in register function and random attributes. Might be useful for unit tests.
function register(server, opts, next) {
server.decorate('server', 'foo', 'bar')
next()
}
module.exports = plugiator.anonymous(register)plugiator.noop([attributes])
Creates a plugin that does nothing.
module.exports = plugiator.noop()
// can have attributes specified
module.exports = plugiator.noop('noop-plugin')
//or
module.exports = plugiator.noop({
name: 'noop-plugin'
})License
MIT © Zoltan Kochan