Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Node.js process.report.filename Property

  • Last Updated : 25 May, 2021

The process.report.filename is an inbuilt application programming interface of class Process within process module which is used to get or set the file name where the report is written.

Syntax:

const process.report.filename

Parameters: This api takes no argument as a parameter.

Return Value: This api returns the file name where the report is written.

 



Example 1: 

index.js




// Node.js program to demonstrate the  
// Process.report.filename Property
  
// Importing process module
const process = require('process');
  
// Assigning the file name
process.report.filename = "GFG"
  
// Display the result
console.log(process.report.filename)

Run the index.js file using the following command:

node index.js

Output:

GFG

Example 2: 

index.js




// Node.js program to demonstrate the  
// Process.report.filename Property
  
// Importing process module
const process = require('process');
  
const filename = process.report.filename;
  
// Display the result
if (filename.length == 0)
    console.log("No file name is assigned")
else
    console.log(filename)

Run the index.js file using the following command:

node index.js

Output:

No file name is assigned

Reference: https://nodejs.org/dist/latest-v16.x/docs/api/process.html#process_process_report_filename

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!