Debugging CoffeeScript line-by-line

前端 未结 6 1739
遥遥无期
遥遥无期 2021-01-30 10:20

Is there a way to debug CoffeeScript line-by-line?

I understand that it compiles into Javascript. But this sounds like it could make it a pain to debug.

6条回答
  •  鱼传尺愫
    2021-01-30 11:16

    Yes, with node-inspector:

    npm install -g node-inspector
    

    By putting the statement debugger into the source code of your script, you will enable a breakpoint. Then type in a console:

    coffee -c -m myscript.coffee
    node-debug myscript.js
    

    Node Inspector supports source-maps out of the box, so no extra configuration is needed.

    For more information see this post.

提交回复
热议问题