How to debug command line input in WebStorm

I have this simple program:

process.stdin.once("data", function (data) { console.log("You said your name is " + data); process.stdin.pause(); }); console.log("What is your name?"); process.stdin.resume(); 

Now I set a breakpoint inside the callback:

enter image description here

And run the program, the console tab will open:

enter image description here

But everything that I enter into the terminal on this console tab does not cause a breakpoint. This console tab does not seem to be the terminal used to receive input from the user.

+6
source share
1 answer

During debugging, make sure that the "Use console input" button on the console panel is not pressed - when it is pressed, the console is in "live" mode, all entered expressions are evaluated, therefore stdin is disabled.

enter image description here

+5
source

Source: https://habr.com/ru/post/1013179/


All Articles