从 Node.js 输出到 Chrome 控制台 [英] Output to Chrome console from Node.js
问题描述
我正在寻找一种将 Node 变量直接输出到 google chrome 浏览器控制台的方法.console.log()
在客户端的工作方式相同.this for php 之类的东西.这将大大加快开发速度.
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. Something like this for php. This would greatly speed up development.
推荐答案
注意:由于旧答案(写于 2014 年 9 月)指的是旧版本的 node-inspector
,我的说明在 2017 年不再相关.此外,文档已经变得更好,所以我更新了我原来的答案:
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 是您所需要的.它会打开一个 Chrome 实例,其中包含用于调试的开发人员工具.
node-inspector is what you need. It opens up an instance of Chrome with its developer tools for debugging.
它也很容易使用:
1.安装
$ npm install -g node-inspector
2.开始
$ node-debug app.js
来源:https://github.com/node-inspector/node-inspector
这篇关于从 Node.js 输出到 Chrome 控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!