Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

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




// Node.js program to demonstrate the  
// Process.report Property
  
// Importing process module
const process = require('process');
  
// Getting reports of the current process
const reports = process.report;
  
// Display the result
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




// Node.js program to demonstrate the  
// Process.report Property
  
// Importing process module
const process = require('process');
  
// If Report is present
if (process.report) {
   // Printing Report Compact Status
   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




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!