- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Node.js – process.report.filename Property
The process.report.filename property is used to get or set the filename where the report will be written. If this value is set as an empty string, the output filename will be made as per the timestamp, PID and sequence number. Its default value is an empty string.
Syntax
process.report.filename
Example 1
Create a file with the name "filename.js" and copy the following code snippet. After creating the file, use the command "node filename.js" to run this code.
// process.report.directory Property Demo Example // Importing the process module const process = require('process'); // Passing the filename process.report.filename = "tutorialspoint" // Printing the result console.log(`Report filename is ${process.report.filename}`)
Output
Report filename is tutorialspoint
Example 2
Let’s take a look at one more example.
// process.report.directory Property Demo Example // Importing the process module const process = require('process'); // Passing the filename const filename = process.report.filename; // Printing the result if (filename.length == 0) console.log("No file name is assigned") else console.log(filename)
Output
No file name is assigned
Advertisements