How to execute code from Node.js server command line?

This question already has an answer here:

  • How do I debug Node.js applications? 31 answers

  • V8 comes with an extensive debugger which is accessible out-of-process via a simple TCP protocol. Node has a built-in client for this debugger. To use this, start Node with the debug argument; a prompt will appear:

    Node's debugger client doesn't support the full range of commands, but simple step and inspection is possible. By putting the statement debugger; into the source code of your script, you will enable a breakpoint.

    http://nodejs.org/api/debugger.html

    Yes this is possible. You just need to write the statement debugger wherever you want your code to stop and you want to use the command line (and start node with the debug argument, eg: node debug app.js

    链接地址: http://www.djcxy.com/p/52638.html

    上一篇: 我如何调试Node.js

    下一篇: 如何从Node.js服务器命令行执行代码?