code: async function recursiveMkdir(dirPath) {
    const prevDirPath = path.dirname(dirPath)
    try {
      await accessSync(prevDirPath)
    } catch (err) {
      // prevDirPath is not exist
      await recursiveMkdir(prevDirPath)
    }
  
    try {
      await accessSync(dirPath)
  
      const stat = await statSync(dirPath)
      if (stat && !stat.isDirectory()) {
        // dirPath already exists but is not a directory
        await renameSync(dirPath, `${dirPath}.bak`) // rename to a file with the suffix ending in '.bak'
        await mkdirSync(dirPath)
      }
    } catch (err) {
      // dirPath is not exist
      await mkdirSync(dirPath)
    }
  }
docs: 递归创建目录