Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get user input Node js console

// first install prompt-sync:
// npm install prompt-sync

const prompt = require("prompt-sync")({ sigint: true });

const age = prompt("How old are you? ");
console.log(`You are ${age} years old.`);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #user #input #Node #js #console
ADD COMMENT
Topic
Name
1+3 =