how to read console input
See original GitHub issuefollowing code snipper works using ‘node’ command, but not works using ‘sjs’ command
process.stdin.on('data', function (chunk) {
process.stdout.write('data: ' + chunk);
}).resume();
Issue Analytics
- State:
- Created 11 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Ways to read input from console in Java - GeeksforGeeks
Ways to read input from console in Java ; import java.io.BufferedReader;. import java.io.IOException;. import java.io.InputStreamReader; ; import ...
Read more >Way to read input from console in C# - Tutorialspoint
Use the ReadLine() method to read input from the console in C#. This method receives the input as string, therefore you need to...
Read more >C# User Input - W3Schools
// Type your username and press enter · "Enter username:" · // Create a string variable and get user input from the keyboard...
Read more >How to Read Java Console Input - DataFlair
Java Console Tutorial-how to read input from console in Java: Java Bufferedreader Class, Scanner Class in Java, Console Class in Java.
Read more >Read and Write User Input in Java | Baeldung
In this quick tutorial, we'll demonstrate several ways to use a console for user input and output in Java. We'll have a look...
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 Free
Top 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
@nfischer I’ve started working on this and I’ve realized that
cat
can be piped like inpwd().cat()
so in order to keep that functionality I propose to use-
as filepath to specify standard input instead of the absence of filepathsFrom
man cat
:Suggestions?
@nfischer I want to read from stdin synchronously. I was expecting that
cat
called without filepaths would do it.Since I haven’t found a way to do it with
shelljs
I have used a stackoverflow snippet showing a cross-platform way of reading stdin synchronously.Would you be interested in a PR for making
cat
reading from stdin when called without arguments?