js基础18-nodejs导论

This commit is contained in:
luzhisheng 2023-03-27 14:24:00 +08:00
parent b9b7d7785b
commit 2ce3761ace
4 changed files with 34 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,6 @@
var a = 1;
debugger
b = function () {
return a + 1;
};
console.log(b);

View File

@ -0,0 +1,28 @@
# 知识点:
## 使用node-inspect 调试线上 nodejs 应用
先安装`inspect`
npm install -g node-inspect
创建一个js文件`js基础18-nodejs导论.js`
var a = 1;
debugger
b = function () {
return a + 1;
};
console.log(b);
启动
node --inspect-brk 猿人学逆向学习/js基础18-nodejs导论/js基础18-nodejs导论.js
打开浏览器控制台左上角的nodejs开发工具
![请求](./img/1.png)
效果图
![请求](./img/2.png)