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

Prompts #3

Closed
thecodeah opened this issue Mar 14, 2021 · 1 comment
Closed

Prompts #3

thecodeah opened this issue Mar 14, 2021 · 1 comment
Labels
feature New feature or request

Comments

@thecodeah
Copy link
Owner

Something like this:

// cli.prompt is synchronous and the rest of the code won't be executed until there's an answer.
const input = cli.prompt("Are you sure you want to do this? (y/N)");
if(input.toLowerCase() !== "y") {
    cli.log("Doing something...");
} else {
    cli.log("Not doing something...");
}
@thecodeah thecodeah added the feature New feature or request label Mar 14, 2021
@thecodeah
Copy link
Owner Author

Added in 64bdc14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant