A toolkit for consumers of Node.js diagnostic Reports
Promise
-based and Observable
-based:rotating_light: WARNING! :rotating_light:
As per semantic versioning, report-toolkit
should be considered experimental until it reaches v1.0.0. Until then, the command-line options, programmatic API or output could change at any time.
report-toolkit
is unlikely to reach v1.0.0 until Diagnostic Reports become a stable Node.js API.
npx report-toolkit --help
or install globally:
npm install -g report-toolkit && \
report-toolkit --help
npm install report-toolkit
and:
// my-app.js
const {inspect} = require('report-toolkit');
async function main() {
const report = JSON.parse(process.report.getReport());
// configuration automatically loaded from `.rtkrc.js` in CWD
const results = await inspect(report);
if (results.length) {
results.forEach(result => {
// log problem and associated rule ID
console.log(`${result.message} (${result.id})`);
});
} else {
console.log('no problems!');
}
}
main();
Diagnostic Reports landed as an experimental feature in Node.js v11.8.0.
The Node.js documentation describes reports:
"The report is intended for development, test and production use, to capture and preserve information for problem determination. It includes JavaScript and native stack traces, heap statistics, platform information, resource usage etc. With the report option enabled, diagnostic reports can be triggered on unhandled exceptions, fatal errors and user signals, in addition to triggering programmatically through API calls."
help wanted
.node
process & interpret results; could be real-timeCopyright © 2019-2020, IBM. Licensed Apache-2.0