Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.33 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.33 KB

Zoro

Handler for runtime processes and events on NodeJS

Overview

This library provides the following:

  1. Error monitoring during runtime processes
    • create error listeners for catching all code-based issues during project runtime
    • format as message to provide informative reports

Installation

To use this, simply install it on a nodejs project by npm i runtime-process-handler

Prerequisite

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

Usage

  1. On your index.js / server.js / app.js, require the package
const RuntimeProcessHandler = require('runtime-process-handler');
  1. Create an instance of the handler
let runtimeProcessHandler = new RuntimeProcessHandler(
  processInstanceOfYourNodeJsProject, // process
  listOfEventsToHandleInArrayFormat, // [ 'processEvent1', 'processEvent2' ... ]
  callbackWhenEventsAreTriggered
);
  1. Start the runtime process handler
runtimeProcessHandler.start();
  1. (Sample) Your events' callback function
function callbackWhenEventsAreTriggered (res) {
   sendEmailFunc(res);
}