sindresorhus / ora

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

[Feature Request] Support time elapsed as suffix string #212

Closed fabriziocucci closed 1 year ago

fabriziocucci commented 2 years ago

It would be great if the library could optionally show the time elapsed while the spinner is on, something like:

⠋ My very long operation (1m 42s)

I'd be happy to contribute this if you think it could be generally useful.

sindresorhus commented 2 years ago

I think it's a bit too niche and there are also many other things that could be useful as a suffix. For example, the remaining time of an operation, percentage, etc.

I think a better way to solve this is to introduce a suffixText option similar to prefixText.

fabriziocucci commented 2 years ago

That would be great! :)