Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node js get input from console

--------------- easiest method I found---------------------------
  
Run npm install prompt-sync in the terminal
const prompt = require('prompt-sync')();

var name = prompt('what is your name?');

console.log(name);

--------------------------------------------------------------
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #node #js #input #console
ADD COMMENT
Topic
Name
1+8 =