Node.js process.report Property
Last Updated :
25 May, 2021
The process.report is an inbuilt application programming interface of class Process within the process module which is used to provide the methods with which diagnostic reports for the current process are generated.
Syntax:
const process.report
Return Value: This property returns the methods with which diagnostic reports for the current process is generated.
Example 1:
index.js
const process = require( 'process' );
const reports = process.report;
console.log(reports)
|
Run the index.js file using the following command:
node index.js
Output:
{
writeReport: [Function: writeReport],
getReport: [Function: getReport],
directory: [Getter/Setter],
filename: [Getter/Setter],
compact: [Getter/Setter],
signal: [Getter/Setter],
reportOnFatalError: [Getter/Setter],
reportOnSignal: [Getter/Setter],
reportOnUncaughtException: [Getter/Setter]
}
Example 2:
index.js
const process = require( 'process' );
if (process.report) {
console.log(process.report.compact)
} else {
console.log( "Unable to print Report Compact Status" )
}
|
Run the index.js file using the following command:
node index.js
Output:
false
Reference: https://nodejs.org/dist/latest-v16.x/docs/api/process.html#process_process_report
Share your thoughts in the comments
Please Login to comment...