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: The string that has the path to the name
Callback: The callback function where stats is an object of fs.stats