Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get input in terminal nodejs

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: #input #terminal #nodejs
ADD COMMENT
Topic
Name
6+5 =