code: function mkDir(p, mode = 0777) {
      if (fs.existsSync(p)) {
          chmod(p, mode);
          return true;
      } else {
          if (mkDir(path.dirname(p))) {
              fs.mkdirSync(p, mode);
              return true;
          }
      }
  }
docs: According to the path p to create a folder, p contains multi-level new path will be automatically recursively created.
  Synchronous mode
  @param {string} p
  @param {number} mode
  @returns {*}