In Node, there does not seem to be a straight-forward way to easily get a single line from the commandline.
Solutions I have found so far:
readline
module'son('line', callback)
[*]readline
'squestion(q, callback)
[*]process.stdin.pipe(require('split')()).on('data', callback)
[*]fs.readFileSync(0).toString
[*]
But all of the above are not nearly as straight forward as python's input
or C++'s std::getline
. (Also, I could not get option (4) to work on Windows.)
The readline
approach is probably the best, but the fact that it requires the use of callbacks
is frustrating.