Node.JS:查看进程为何仍在运行的工具?
有没有办法查看哪些超时、间隔或异步操作(或无限循环)仍在运行并阻止我的进程结束?
到目前为止,我已经能够在没有这样的工具的情况下解决这个问题,但是这样的工具会非常方便,尤其是当这里的 Node.JS 项目开始变得更大时。
我正在考虑 Java 的 kill -3
,它将堆栈跟踪打印到 stderr。您可以在任何时间对任何进程执行此操作,无论调试与否。我想要 Node.JS 的等效版本。 (我知道节点是异步单线程的,所以它的输出会有所不同)
Is there a way to see what timeouts, intervals or async operations (or endless loops) are still running and are stopping my process from ending?
I have been able to figure it out so far without such a tool, but such a tool would be very handy especially as the Node.JS projects here start to get bigger.
I am thinking of Java's kill -3
which prints a stack trace to stderr. You can do this for any process, any time, debug or no. I would like an equivalent for Node.JS. (I know that node is single threaded with async so it would output differently)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模块 why-is-node-running 正是您所需要的。
输出类似于:
The module why-is-node-running is exactly the thing you need.
And the output is something like: