NodeJs调试

node-inspect

1
node-debug index.js

chrome devtools

node –inspect来调试,在需要调试的地方设置下debugger, 在chrome浏览器中,打开commandline中提示的调试地址

1
2
3
4
5
6
"scripts": {
"start": "node ./worker | bunyan",
"debug": "node --inspect --debug-brk ./worker | bunyan",
"lint": "eslint . --fix && echo 'Eslint Passed\\n'",
"test": "eslint . --fix && echo 'Eslint Passed\\n' && node test/ | faucet"
}