Skip to content

Commit

Permalink
Make mkdir method in utils
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunSangHan committed Mar 15, 2020
1 parent 2f26478 commit e752247
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,3 +853,18 @@ exports.supportsEsModules = function() {
}
}
};

/**
* Creates new directories recursively.
*
* @description
* This function is to create a new directory and any necessary subdirectories at the directory.
* `fs.mkdir` with {recursive: true} can be a replacement for `mkdirp`.
*
* @private
* @param {string} pathname - Directory path to create.
* @returns {undefined} void
*/
exports.mkdir = function(pathname) {
fs.mkdirSync(pathname, {recursive: true});
};

0 comments on commit e752247

Please sign in to comment.