Output to Chrome console from Node.js

前端 未结 6 976
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 16:40

I\'m looking for a way to output Node variables directly into the google chrome browser console. The same way a console.log() works on the client side. Somethin

6条回答
  •  Happy的楠姐
    2020-12-09 17:11

    NOTE: Since the old answer (written in september 2014) refers to an older version of node-inspector, my instructions are not relevant anymore in 2017. Also, the documentation has gotten a lot better, so I have updated my original answer:

    node-inspector is what you need. It opens up an instance of Chrome with its developer tools for debugging.

    It's also easy to use:

    1. Install

    $ npm install -g node-inspector
    

    2. Start

    $ node-debug app.js
    

    Source: https://github.com/node-inspector/node-inspector

提交回复
热议问题