Visual Studio Code redirect input on debug

前端 未结 1 2095
借酒劲吻你
借酒劲吻你 2020-12-18 03:01

My application is reading from stdin:

var input = process.stdin.read();

Is it possible to configure Visual Studio Code to redirect input on

相关标签:
1条回答
  • 2020-12-18 03:28

    The args array is generally for Node.js startup and 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 at the command line to see the full list of V8 runtime flags.

    I'd recommend you start your application with the debug flag from the command line so you can direct it to take stdin and then attach the debugger to your running process.

    > node --debug app.js
    Debugger listening on port 5858
    

    You can have multiple configurations in your launch.json file. Add or modify one to be your "Attach" debug configuration. For attaching, "address" and "port" must be specified (please note that "address" must be set to "localhost" since remote debugging is not yet supported). Port should be the one that the debug startup process returned above.

    Once your application is running on the port specified, you can change the debug target in the dropdown next to the play/run icon.

    0 讨论(0)
提交回复
热议问题