node.js - Visual Studio Code redirect input on debug -
my app reading stdin.
var input = process.stdin.read(); is possible configure visual studio code redirect input on debug? equal command line:
node app.js < input.txt this config not working, debug not starting.
{ "name": "launch", "type": "node", "program": "app.js", "stoponentry": false, "args": [ "<", "input.txt" ] }
the args array node startup , v8 engine runtime flags.
--no-deprecation --throw-deprecation --trace-deprecation --v8-options --max-stack-size=val --icu-data-dir=dir --enable-ssl2 --enable-ssl3 type node --v8-options @ command line see full list of v8 runtime flags.
i'd recommend start app debug flag command line can direct take stdin , attach debugger running process.
> node --debug app.js debugger listening on port 5858 you can have multiple configurations in launch.json file. add or modify 1 "attach" debug config. attaching, "address" , "port" must specified (please note "address" must set "localhost" since remote debugging not yet supported). port should 1 debug startup process returned above.
once app running on port specified, can change debug target in dropdown next play/run icon.


Comments
Post a Comment