在运行时获取调试参数

时间:2013-10-13 06:26:50

标签: node.js debugging

除了检查process.execArgv和操作字符串之外,是否有更简单的方法来确定Node进程是否正在侦听调试连接,如果是,在哪种模式下以及在哪个端口上?在process API页面上没有看到任何内容。

1 个答案:

答案 0 :(得分:2)

process有一个debugPort属性:

if (typeof v8debug !== 'undefined') {
    console.log('In debug mode and listening on port: ' + process.debugPort);
}