Bun.input()
#6191
Replies: 2 comments 1 reply
-
you could try |
Beta Was this translation helpful? Give feedback.
0 replies
-
@bdotsamir what have you ended up using? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The built-in node.js readline module is clunky and weird to use. It's not impossible to understand, simply attach the module to process.stdin and wait for the
line
event to be emitted.But that's weird, and frankly, other languages make it way easier. Looking at you, Python.
It would be great for Bun to expose an async
input()
method on the Bun namespace, maybe optionally providing a prompt. Once the user hits enter, the string the user entered is returned.I'm teaching a group of students on how to code using TypeScript, and in lieu of setting up tsc, I'm using Bun (which has been awesome so far!). I want them to be able to input things from the terminal, but it's weird as hell to have them set up the readline module with the event listener.. that's just one more thing I need to go over with them in the short time we have together in class.
Beta Was this translation helpful? Give feedback.
All reactions