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
const process = require( 'process' );
process.report.filename = "GFG"
console.log(process.report.filename)
|
Run the index.js file using the following command:
node index.js
Output:
GFG
Example 2:
index.js
const process = require( 'process' );
const filename = process.report.filename;
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
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!