()
| 28 | let tick = 0 |
| 29 | |
| 30 | const printProgress = () => { |
| 31 | const running = total - done - failed |
| 32 | const s = spinner[tick++ % spinner.length] |
| 33 | const status = failed |
| 34 | ? `${running} running, ${done} done, ${chalk.bgRed.white.bold(` ${failed} failed `)}` |
| 35 | : `${running} running, ${done} done` |
| 36 | process.stderr.write(`\r${chalk.bgCyan.black.bold(` ${s} ${done}/${total} `)} ${status} `) |
| 37 | } |
| 38 | |
| 39 | const timer = setInterval(printProgress, 1000) |
| 40 | printProgress() |