Hemera-plugin package
hemera-plugin
is a plugin helper for Hemera.
Usage
hemera-plugin
can do some things for you:
- Check the bare-minimum version of Hemera
- Provide consistent interface to register plugins even when the api is changed
Example:
const hp = require('hemera-plugin')
module.exports = hp(function (opts, next) {
const hemera = this
next()
})
If you need to set a bare-minimum version of Hemera for your plugin, just add the semver range that you need:
const hp = require('hemera-plugin')
module.exports = fp(function (opts, next) {
const hemera = this
next()
}, '0.x')
You can check here how to define a semver
range.
Credits
fastify-plugin