Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interrupt method #54

Closed
wants to merge 2 commits into from
Closed

Add interrupt method #54

wants to merge 2 commits into from

Conversation

RodEsp
Copy link

@RodEsp RodEsp commented Aug 15, 2017

The interrupt method allows the user to maintain a the spinner on a single line while writing new messages to the output.

This addresses #49 to a degree. It only allows you to print lines above the spinner, not below. But at least your spinner isn't duplicated on different lines.

2017-08-14_21-00-17

@kbrandwijk
Copy link

Any chance of getting this merged? Would really help my use case too...

@sindresorhus
Copy link
Owner

The code looks good, but I'm not sold on the method name. interrupt makes it sound like the spinner is actually interrupted, but it's the opposite. Can someone think of a better name?

@kbrandwijk
Copy link

It's similar to what other progress libraries use. I've used https://github.com/visionmedia/node-progress a lot in the past, it has exactly the same interrupt() method.

@RodEsp
Copy link
Author

RodEsp commented Dec 18, 2017

Doesn't really matter to me. interject() or interpose() could be good alternatives or even just insert().

@kbrandwijk
Copy link

or log(), or out() or ...

@novemberborn
Copy link
Contributor

#69 makes it so .clear() can be called followed by .render(). This means you can clear the current spinner, write new lines, and then re-render the spinner. I think that solves the original use case.

@RodEsp RodEsp closed this Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants