1.

How Will You Get Information About A File Using Node?

Answer»

Following is the syntax of the METHOD to get the INFORMATION about a FILE:
fs.stat(path, callback)
Parameters
Here is the description of the parameters used:
path - This is string having file name including path.
callback - This is the callback function which gets two arguments (err, stats) where stats is an object of fs.Stats TYPE which is PRINTED below in the example.

 

Following is the syntax of the method to get the information about a file:
fs.stat(path, callback)
Parameters
Here is the description of the parameters used:
path - This is string having file name including path.
callback - This is the callback function which gets two arguments (err, stats) where stats is an object of fs.Stats type which is printed below in the example.

 



Discussion

No Comment Found