我可以获取节点-检查以自动打开Chrome吗 [英] Can I get node --inspect to open Chrome automatically

查看:89
本文介绍了我可以获取节点-检查以自动打开Chrome吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新版本的node中,node-inspector是内置的,可以使用命令node --inspect index.js触发.但是,这总是为命令行提供必须插入地址栏的地址.我知道这可能不是最安全"的方法,但是有没有办法消除复制和粘贴的步骤?

In the new versions of node, node-inspector is built in and can be fired using the command node --inspect index.js. However, this always provides a command line with the address you have to plug into the address bar. I know this may not be the most "secure" but is there a way to eliminate that copy and paste step?

推荐答案

在Chrome 60+中,chrome://inspect/#devices网址(以及Node)中有一项为Node打开专用的DevTools" Node运行时在DevTools中显示.js图标).启动或重新启动后,打开的检查窗口将立即连接到Node.js,因此无需每次都手动打开它.

In Chrome 60+ there is an item "Open dedicated DevTools for Node" in chrome://inspect/#devices url, (as well as Node.js icon in DevTools while Node is running). The opened inspect window will connect to Node.js as soon as it starts or restarts, so there is no need to open it manually each time.

这篇关于我可以获取节点-检查以自动打开Chrome吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆