Add sync version of std/io readLines
See original GitHub issueIt would be useful to provide a function that can read a line of input from stdin that has a simple interface. It would probably good to support both async and sync versions, something like
const name: string = await Deno.readLine('What is your name? ');
const age: string = Deno.readLineSync('What is your age? ');
I think readLine
might be too close to the file functions, so maybe something like getInput
or ttyReadLine
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:31 (20 by maintainers)
Top Results From Across the Web
readline-sync - npm
Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).. Latest version: 1.4.10, ...
Read more >4.8. Input with readline-sync - LaunchCode Education
Try adding another + name term inside the console.log statement and see what happens. Next, add code to prompt the user for a...
Read more >How to get synchronous readline, or "simulate" it using async ...
My condition is to allow reading (single) lines using the getline type function using the readline interface in a clean "synchronous" way or...
Read more >readLineSync method - Stdin class - Flutter - Dart API docs
API docs for the readLineSync method from the Stdin class, for the Dart programming language.
Read more >How to use the readline-sync.question function in ... - Snyk
readFileSync (infoPath)) || {}; } else { console.log('Creating ' + infoPath + ' -- please add it to .gitignore if applicable'); } if...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s now possible to do that using
readLines
fromstd/io/bufio.ts
I believe this could be implemented in pure TS with
Deno.stdin
, so we should probably put this in deno_std