-
Notifications
You must be signed in to change notification settings - Fork 3
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
logger: Prompting the user #25
Comments
This would be interesting. Though for this exact proposal I would like multi() to be a part of select(), as like an object that has options. An alternative API for prompting for things could be a function similar to how The implementation of these should be done using the LogWidget API, and maybe by implementing a function like |
note that we cannot use prompts directly as it will have issues when you call log functions while the prompt is visible. this is a small edge case that my library handles for spinners and other widgets, so by simply extending LogWidget, this behavior is automatically available. |
[see the above commit, or here's an interesting function i wrote, only works on bun as of now. it reads one character from stdin and returns immediatly. no enter button needed. might be interesting if log widgets could specify like a |
To reduce the use of multiple packages, one could implement a prompt system. It should be similar to this package.
I'm suggesting following functions:
confirm(text: string)
(Simple yes/no prompt)prompt(text: string)
(Asking a question)select(text: string, choices: string[])
(Selecting a single value from a list of values)multi(text: string, choices: string[])
(Selecting multiple values from a list of values)Examples can be found on the mentioned NPM-Package.
The text was updated successfully, but these errors were encountered: