Course lesson
Parse User Input in Node.js with readline
Reading user input is a big aspect of this project because we will be asking for a question or an answer for the CLI to work with.
- Duration
- 5 min
- Access
- Included
- Transcript
- Retained from source evidence
Reading user input is a big aspect of this project because we will be asking for a question or an answer for the CLI to work with.
Node has some internal options for parsing user input. We will check out the readline module and how it parses input. We will also see the promise driven version of the module and use a top level await to ask questions in the CLI.
This package has some limitations in how you present questions to your user though so if presentation is important to you, you will want to consider using a 3rd party library.