Handler for runtime processes and events on NodeJS
This library provides the following:
- Error monitoring during runtime processes
- create error listeners for catching all code-based issues during project runtime
- format as message to provide informative reports
To use this, simply install it on a nodejs project by npm i runtime-process-handler
To be able to know what are the process events you can trigger or start listening to, you may refer to the following reference: NodeJS Process
- On your index.js / server.js / app.js, require the package
const RuntimeProcessHandler = require('runtime-process-handler');
- Create an instance of the handler
let runtimeProcessHandler = new RuntimeProcessHandler(
processInstanceOfYourNodeJsProject, // process
listOfEventsToHandleInArrayFormat, // [ 'processEvent1', 'processEvent2' ... ]
callbackWhenEventsAreTriggered
);
- Start the runtime process handler
runtimeProcessHandler.start();
- (Sample) Your events' callback function
function callbackWhenEventsAreTriggered (res) {
sendEmailFunc(res);
}