Answers for "readline sync javascript"

0

readline sync javascript

var readlineSync = require('readline-sync'); // Wait for user's response.
var userName = readlineSync.question('May I have your name? ');
console.log('Hi ' + userName + '!');

// Handle the secret text (e.g. password).
var favFood = readlineSync.question('What is your favorite food? ', {
	hideEchoBack: true // The typed text on screen is hidden by `*` (default).
});
console.log('Oh, ' + userName + ' loves ' + favFood + '!');
Posted by: Guest on June-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language