Inquirer.js
Inquirer.js copied to clipboard
Clear the questionnaire ?
how do I clear the entire questionnaire after all of it is asked.
Do you mean to clean the terminal?
@SBoudrias yes but not the whole console. just the output. Something like logUpdate module where the output is replaced with another... only in my case it has to be replaced with nothing.
Any update?
Jump out of your question, I think Ink is a better tool to implement your idea.
I've just implemented that by using console.clear
:
In my case, I have multiple prompts, and before jumping from one to another, I run a console.clear
and then show my CLI title again.
Hello, I've added this feature in our new prompts (the @inquirer/*
modules.)
@SBoudrias, what do you mean exactly?
Is there documentation about this somewhere?
There's types and documentation per prompts; but not a great consolidated doc yet. Here's an example code:
import confirm from '@inquirer/confirm';
const answer = await confirm(
{ message: 'Confirm action?' },
{ clearPromptOnDone: true }
);