Diagnostics and reports
A Node diagnostic report records runtime and process state to help investigate failures. It may include sensitive environment, command-line, path and network information; never share a raw production report by default. `process.report.getReport()` returns a report object for the current process. The report can contain header, JavaScript and native stacks, heap summaries, resource usage and other environment information. Prefer explicit field selection rather than attempting to blacklist every secret. This fixture runs under a synthetic environment and prints only counts or booleans. Diagnostic reports differ from CPU profiles and heap snapshots: choose evidence based on the symptom. Trace events can record timeline categories; actual traces and inspector data may be sensitive, so keep them local and bounded. Do not collect an actual production report without authorization. Never upload full reports, heap snapshots, or trace files without authorization and explicit redaction review. Sources: https://nodejs.org/download/release/v22.16.0/docs/api/report.html.
Formal Syntax & Structure
process.report.getReport([err])Working Example
import assert from 'node:assert/strict';const report=process.report.getReport();assert.equal(report.header.nodejsVersion,process.version);console.log(JSON.stringify({versionMatches:true,hasHeapSummary:typeof report.javascriptHeap==='object'}));