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()
  })

Popular Posts

java:17: error: local variables referenced from a lambda expression must be final or effectively final count ++ ;

Family Tree Project in Java

Creating basic tic tac toe android app using java