Question - How to get information about a file in Node.js?
Answer -
The fs.stat function is used to get the required information from a file.
The syntax is as follows:
fs.stat(path, callback)
where,
• Path is the string that has the path to the name
• Callback: The callback function where stats is an object of fs.stats
Next up on these Node js interview questions, you need to understand about DNS lookup.