How to take input from user in sublime 3 in JavaScript? [ SOLVED ]
[SOLVED] Take console (cmd) input in sublime 3 text editor in javascript
Open Sublime goto > Tools > Build System > Build New System
paste the following code in that file and save it as anyName.sublime-build
{
"cmd":["start", "cmd", "/k" ,"node","$file_base_name"],
"selector": "source.jW",
"working_dir": "${file_path}",
"shell": true
}
And now in your js file add these lines. Help from official website : click here
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
})
readline.question(`What's your name?`, name => {
console.log(`Hi ${name}!`)
readline.close()
})
