高级前端
node
【Q698】有没有使用过 Node 的 inspect 这个核心模块

有没有使用过 Node 的 inspect 这个核心模块

更多描述 文档:Node Inspector API (opens in a new tab)

const inspector = require("inspector");

Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 720 (opens in a new tab)

Author 回答者: shfshanyue (opens in a new tab)

const session = new inspector.Session();
session.connect();
session.post("Profiler.enable", () => {
  session.post("Profiler.start", start);
});

Author 回答者: iceycc (opens in a new tab)

inspector 模块提供了与 V8 检查器交互的 API。