code: function (p, mode, made) {
        if (mode === undefined) {
          mode = 0o777 & (~process.umask());
        }
        if (!made) made = null;
  
        if (typeof mode === 'string') mode = parseInt(mode, 8);
        p = path.resolve(p);
  
        try {
          fs.mkdirSync(p, mode);
          made = made || p;
        } catch (err0) {
          switch (err0.code) {
            case 'ENOENT' :
              made = swig.fs.mkdir(path.dirname(p), mode, made);
              swig.fs.mkdir(p, mode, made);
              break;
            default: {
              let stat;
              try {
                stat = fs.statSync(p);
              } catch (err1) {
                throw err0;
              }
              if (!stat.isDirectory()) throw err0;
              break;
            }
          }
        }
  
        return made;
      }
docs: https://raw.githubusercontent.com/substack/node-mkdirp/master/index.js