Closed mblais closed 9 months ago
Just create a Ora instance and update the .spinner
property manually as the promises resolve.
This works for me:
if (options.quiet) {
// No spinner
response = await fetch(url, payload)
} else {
// Show spinner
const spinner = ora(options.verbose ? `${method} ${url}` : '').start()
response = await fetch(url, payload)
if (options.verbose) spinner.succeed() // Stop the spinner but keep the message line
else spinner.stop() // Delete the entire spinner line
}
I have a series of fetches where I display a spinner for each one, and when each fetch resolves, the spinner shows a checkmark and EOL. This results in a series of "checkmark" lines in my output (I'm not supplying any spinner text).
For these calls I would prefer to "re-use" the spinner line instead of having it output a newline when it's finished.
Is this possible?