Gathering detailed insights and metrics for sandbox-debugger-server
Gathering detailed insights and metrics for sandbox-debugger-server
Gathering detailed insights and metrics for sandbox-debugger-server
Gathering detailed insights and metrics for sandbox-debugger-server
npm install sandbox-debugger-server
Typescript
Module System
Node Version
NPM Version
57.1
Supply Chain
90
Quality
74.3
Maintenance
50
Vulnerability
99.3
License
JavaScript (98.3%)
Dockerfile (1.7%)
Total Downloads
13,631
Last Day
2
Last Week
11
Last Month
36
Last Year
1,610
11 Stars
299 Commits
1 Watchers
6 Branches
1 Contributors
Updated on Nov 21, 2024
Latest Version
0.2.45
Package Id
sandbox-debugger-server@0.2.45
Unpacked Size
8.99 kB
Size
3.25 kB
File Count
3
NPM Version
10.1.0
Node Version
20.9.0
Published on
Dec 08, 2023
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
175%
11
Compared to previous week
Last Month
-80.3%
36
Compared to previous month
Last Year
46.6%
1,610
Compared to previous year
4
Debug a Node.js process anywhere using chrome://inspect
or node-inspect
node debug port 9229 | ⟷ | sandbox debug client | ⟷ | sandbox debug broker |
---|
Interactive debugging using inspect, debug the same way you do with a local process.
Supports a Node.js process running
How it works?
Node opens a websocket when in debug mode, both the sandbox server and client work by piping the websocket data via the broker.
The server is used as a gatekeeper for the debug messages.
1npx sandbox-debugger-server
or
1ᐅ docker run \ 2 --name sandbox-debugger \ 3 -ti \ 4 --rm \ 5 -p 9229:9229 \ 6 jameskyburz/sandbox-debugger
The server will output
1 Debug server started! 2 3 - To debug a new process: 4 export DEBUG_PROXY=xxx.xxx.x.xxx:9229 5 node index.js 6 7 - To debug an existing process: 8 export DEBUG_PROXY=xxx.xxx.x.xxx:9229 9 export DEBUG_PID=<pid of node process> 10 npx sandbox-debugger 11 12 - Find pid of first running Node.js process 13 ps ax | 14 grep 'no[d]e ' | 15 awk '{print $1}' | 16 head -n 1 17 18 - Allow remote access to me: 19 npx ngrok http 9229 --scheme http
Using ngrok you can tunnel to the locally running broker from for example aws lambda.
1npx ngrok http 9229 --scheme http
1// index.js 2require('sandbox-debugger') 3debugger 4console.log('all done')
1# DEBUG_PROXY is ip:port to sandbox broker 2DEBUG_PROXY=ip:port node index.js
1# DEBUG_PROXY is ip:port to sandbox broker 2# DEBUG_PID is pid of process to debug 3DEBUG_PROXY=ip:port DEBUG_PID=x npx sandbox-debugger
Environment variable DEBUG_PROXY
needs to point to the ngrok
address including the port part :80
.
The easiest way to debug lambda is to edit the code in aws console.
Copy the contents of https://unpkg.com/sandbox-debugger@latest/dist/index.js
to debug.js, and require('./debug.cjs')
instead of sandbox-debugger
ESM example
1 import { createRequire } from 'node:module' 2 const require = createRequire(import.meta.url) 3 require('./debug.cjs')
No vulnerabilities found.