Delivers a human-readable diagnostic summary, written to file.
Supports Node.js v4, v6 and v7 on Linux, MacOS, Windows and AIX.
npm install nodereport
var nodereport = ;nodereport;
$ node > nodereport = require('nodereport') > nodereport.triggerReport() Writing Node.js report to file: NodeReport.20161020.091102.8480.001.txt Node.js report completed >
When a NodeReport is triggered, start and end messages are issued to stderr
and the filename of the report is returned to the caller. The default filename
includes the date, time, PID and a sequence number. Alternatively, a filename
can be specified as a parameter on the
A NodeReport can also be triggered automatically on unhandled exceptions, fatal error events (for example out of memory errors), and signals (Linux/MacOS only). Triggering on these events can be enabled using the following API call:
Additional configuration is available using the following APIs:
Configuration on module Initialization is also available via environment variables:
export NODEREPORT_EVENTS=exception+fatalerror+signal+apicallexport NODEREPORT_SIGNAL=SIGUSR2|SIGQUITexport NODEREPORT_FILENAME=stdout|stderr|<filename>export NODEREPORT_DIRECTORY=<full path>export NODEREPORT_COREDUMP=yes|noexport NODEREPORT_VERBOSE=yes|no
To see examples of NodeReports generated from these events you can run the demonstration applications provided in the nodereport github repository. These are Node.js applications which will prompt you to trigger the required event.
exception.js- NodeReport triggered by unhandled exception.
loop.js- looping application, NodeReport triggered using kill