Question:

How will you create a directory?

Answer:

Following is the syntax of the method to create a directory:

fs.mkdir(path[, mode], callback)

Parameters

Here is the description of the parameters used:

  • path - This is the directory name including path.

  • mode - This is the directory permission to be set. Defaults to 0777.

  • callback - This is the callback function which gets no arguments other than a possible exception are given to the completion callback.


Keywords:

© 2017 QuizBucket.org