sindresorhus / ora

Elegant terminal spinner
MIT License
9.08k stars 269 forks source link

If I change text in the for loop, it doesn't work #216

Closed bfrontend closed 2 years ago

bfrontend commented 2 years ago
import ora from 'ora';
const spinner = ora().start()
for (let i = 0; i< 100; i++) {
    spinner.text = `run time ${i}`
}
sindresorhus commented 2 years ago

Looping through 100 numbers is so fast that it would not be visible. You need to add a delay.