"use strict";
process.stdin.setEncoding('utf8');
process.stdin.on('readable', ()=> {
let input = process.stdin.read();
if (input !== null) {
input = input.trim();
}
if (input == 'exit' || input == 'quit' || input == 'bye') {
process.exit();
}
console.log('Input:', input);
});
Created
August 13, 2016 13:04
-
-
Save umidjons/b1702a3883b86a0c0cc8b4df2ae8abed to your computer and use it in GitHub Desktop.
Get input from standard input stream example
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment