Skip to content

Module for wrapping 3rd-party/custom error reporting mechanisms

Notifications You must be signed in to change notification settings

anyTV/runtime-process-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

Module for wrapping 3rd-party/custom error reporting mechanisms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published