Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

Node.js Method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The method writes a diagnostic report to a file. If filename is not provided, the default filename includes the date, time, PID, and a sequence number. The report’s JavaScript stack trace is taken from err, if present.

Syntax:[filename][, err])

Parameters: This method accepts two parameters as mentioned above and described below:

  • filename: This parameter holds the file name where the report will be written.
  • err: This parameter used for reporting the javascript stack.

Return Value: This method returns the filename of the generated report.

Below examples illustrate the use of the property in Node.js:



// Node.js program to demonstrate the 
// Property 
// Include process module 
import process from 'process'
// Printing property value;

Command to run:

node filename


Note: The above program will compile and run by using the node filename.js command.


My Personal Notes arrow_drop_up
Last Updated : 08 Mar, 2021
Like Article
Save Article
Similar Reads
Related Tutorials