Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript read input from terminal

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
 
readline.question('Who are you?', name => {
  console.log(`Hey there ${name}!`);
  readline.close();
});
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #javascript #read #input #terminal
ADD COMMENT
Topic
Name
5+5 =