{"id":28540721,"url":"https://github.com/leecade/node-debug","last_synced_at":"2025-10-04T12:57:22.677Z","repository":{"id":34691460,"uuid":"38666164","full_name":"leecade/node-debug","owner":"leecade","description":"node debug note","archived":false,"fork":false,"pushed_at":"2015-07-07T07:18:17.000Z","size":132,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-07T11:41:24.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leecade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-07T05:28:57.000Z","updated_at":"2015-07-07T07:12:08.000Z","dependencies_parsed_at":"2022-09-14T18:21:35.057Z","dependency_job_id":null,"html_url":"https://github.com/leecade/node-debug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leecade/node-debug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leecade%2Fnode-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leecade%2Fnode-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leecade%2Fnode-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leecade%2Fnode-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leecade","download_url":"https://codeload.github.com/leecade/node-debug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leecade%2Fnode-debug/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265468017,"owners_count":23770819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-09T19:37:07.999Z","updated_at":"2025-10-04T12:57:22.579Z","avatar_url":"https://github.com/leecade.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-debug\n\nnode debug note\n\n## Considering\n\n- Hot config\n\n- Remote control\n\n- AOP monitoring\n\n- Friendly debug node in chrome\n\n## DEMO\n\n1. run a example server\n\n  ```js\n  node example/server.js\n  ```\n\n  \u003e Visit http://localhost:8001 to see the message\n\n  record the `pid`, then\n\n2. enter debug mode and connect by the `pid`\n\n  ```js\n  node example/debugger.js `pid`\n  ```\n  \n Refresh the browser, you may see content has changed\n\n----\n\n## About node debug\n\n### How to enter debug mode\n\n- Way 1\n\nstartup with `--debug-brk` param\n\n```js\nnode --debug-brk=5858 [filename]\n```\n\n- Way 2\n\nSend a `SIGUSR1` signal to node process\n\n\u003e For example\n\n```bash\n$ kill -SIGUSR1 4162\n```\n\nWhen node process enter debug mode, there will open a TCP port for listen (default port is `5858`)\n\n### Connect a debug process\n\n```js\nnode debug localhost:5858\n```\n\nThen the process is hang on, type these basic commands:\n\n\u003ckbd\u003ec\u003c/kbd\u003e Go on\n\n\u003ckbd\u003es\u003c/kbd\u003e Step into next function\n\n\u003ckbd\u003eo\u003c/kbd\u003e Step out of current function\n\n### Debugger protocol\n\nsimple:\n\n```js\nvar msg = {\n  'command': 'evaluate',\n  'arguments': {\n    'expression': 'global.message=\"' + 'newMessage' + '\"',\n    'global': true\n  }\n}\n```\n\nsend the message:\n\n```\nclient.req(msg, function (err, body, res) {})\n```\n\n### Ref\n\nhttps://github.com/buggerjs/bugger-v8-client/blob/master/PROTOCOL.md\n\nhttps://github.com/joyent/node/blob/master/lib/_debugger.js\n\nhttps://github.com/oneapm/node-oneapm-debugger\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleecade%2Fnode-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleecade%2Fnode-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleecade%2Fnode-debug/lists"}