README
v50-hemera-loader (ES6, ALFA)
v50-hemera-loader wrapper to load hemera object or spawn hemera detached process.
Installation
npm -i --save v50-hemera-loader
API Reference
createHemera((err, hemera) => {
hemere // Hemera Object
})
createHemera(hemeraOptions, natsOptions, (err, hemera) => {
hemere // Hemera Object
})
// './test/executeModule.js'
module.exports = hemera => {
hemera.add({topic: 'math', cmd: 'add'}, (req, res) => {
return res(null, true)
})
}
const uncaughtException = error => {
throw new Error(error)
}
// Spawn detached node process with hemera
createHemeraInstance(resolve('./test/executeModule.js'), uncaughtException, (err, node) => {
node.kill()
})
createHemeraInstance(resolve('./test/executeModule.js'), hemeraOptions, natsOptions, uncaughtException, (err, node) => {
node.kill()
})
For more examples see tests
Tests
npm test
Contributors
Edgars Mjasnikovs
License
MIT