Diagnostic Reports
This utility tool is known as node-report that was recently brought into the Node.js core. It helps to detect abnormal terminations, memory leaks, high CPU usage, unexpected errors and more in Nodejs development.
Run the node --experimental-report --report-on-fatalerror index.js to get a JSON summary on native stack traces, heap statistics, resource usage, etc.
Node.js got a bunch of diagnostic utilities within the recent versions to help the investigation on errors and bottlenecks that area unit troublesome to pinpoint. If you would like to form runtime statistics of the heap usage you'll try this by occupation v8.getHeapSnapshot() that was added in v11.13.0.