code: async function downloadTemplate(config, proxy) {
    const templateProject = path.join(templateDir, config.name)
    let hasDownload = await checkDirExist(templateProject)
    let timer
  
    if (!hasDownload) {
      // mock download progress
      let total = 20
      const msg = 'now downloading template project'
      const bar = new ProgressBar(':bar :token1', {
        total, incomplete: '░', complete: '█', clear: true
      })
      const tick = () => setTimeout(() => {
        total--
        bar.tick({token1: msg})
  
        if (total !== 1 && !bar.complete) tick()
      }, 500)
      const stop = () => {
        while (!bar.complete) bar.tick({token1: msg})
      }
  
      try {
        timer = setTimeout(() => {
          // 超过一分钟没下载完，直接退出进程
          if (!bar.complete) {
            stop()
            // eslint-disable-next-line no-console
            console.log('download faild!')
            process.exit(1)
          }
        }, 60 * 1000)
  
        tick() // 开始
  
        await download(config.download, templateProject, {
          extract: true,
          strip: 1,
          mode: '666',
          headers: {accept: 'application/zip'},
          proxy,
        })
  
        stop() // 结束
      } catch (err) {
        stop()
        // eslint-disable-next-line no-console
        console.error(err)
      }
  
      if (timer) timer = clearTimeout(timer)
    }
  }
docs: 下载模板项目