【发布时间】:2012-10-10 17:42:02
【问题描述】:
在 Node.js 中,我试图获取脚本中调用的每个函数的行号。有没有办法生成脚本中调用的每个函数的摘要?我想获取脚本中每个函数调用的行号列表,以便我可以注释掉其中一个函数调用(我仍在尝试查找。)
一个例子:
function printStuff(){
console.log("This is an example.");
}
printStuff();
printStuff();
现在我想获得此脚本中所有事件的摘要(无需修改脚本)。它可能看起来像这样:
calling printStuff at line 4
calling console.log at line 2
calling printStuff at line 5
calling console.log at line 2
是否有任何测试/调试工具可以做到这一点?
【问题讨论】:
-
我写了一个超过 2000 行的脚本,所以我需要找到脚本中每个函数调用的行号。
标签: javascript node.js