The node-report module is pre-installed in the IBM SDK for Node.js version 6.10.0, so there is no need to install the node-report npm yourself.
Reports can be enabled without any code changes, simply using the -r node-report command-line option when starting your Node.js application.
node -r node-report application.js
var nodereport = require('node-report'); nodereport.triggerReport(); var report_str = nodereport.getReport(); console.log(report_str);
If required, the node-report API can be enabled without adding the automatic exception and fatal error hooks and the signal handler, as follows:
var nodereport = require('node-report/api'); nodereport.triggerReport();
Example report for out-of-memory error in a Node.js application
The following screen shot shows part of a report generated by the node-report module for an out-of-memory scenario, running the IBM SDK for Node.js version 6.10.0 on Linux on System x 64-bit.
For further information about the node-report module see: