How will you read a directory?
Following is the syntax of the method to read a directory:
Here is the description of the parameters used:
path - This is the directory name including path.
callback - This is the callback function which gets two arguments (err, files) where files is an array of the names of the files in the directory excluding '.' and '..'.