node js command line prompt get user input code example
Example: get input from user in nodejs
const prompt = require('prompt-sync')(); const name = prompt('What is your name?');console.log(`Hey there ${name}`);
const prompt = require('prompt-sync')(); const name = prompt('What is your name?');console.log(`Hey there ${name}`);