CÁCH DEBUG TRONG NODEJS.
1. Sử dụng node-inspector mô đun.
Cài đặt: npm install node-inspector –g
Chạy ứng dụng ờ chế độ bật tính năng debug
Node –debug app.js
Port Webkit của node-inspector là : 5858
Mở 1 console node khác chạy: node-inspector [–web-port=custom_port_number]
Truy cập vào: http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858
nếu app của bạn chạy trên port 8080
2. Script tab: List ra các file nodejs
và các file third party.
3. Profiles tab:
Cài đặt: npm install v8-profiler
4. Console tab: REPL in global scope.
Nhận xét
Đăng nhận xét