jhmaster2000 / bun-repl

Experimental REPL for Bun
https://www.npmjs.com/package/bun-repl
MIT License
74 stars 8 forks source link

send commands to repl via WebSocket #10

Closed sfrieske closed 1 year ago

sfrieske commented 1 year ago

How can I send a command from a WebSocket client to the REPL, e.g. console.log(3+4) ?

jhmaster2000 commented 1 year ago

If you run the repl with the --debug flag it will print out the local websocket server url at the start. The message protocol is a limited version of the V8 inspector protocol, there's unfortunately no docs for JSC's specific supported parts of it, but you may find the bun-devtools package on npm helpful (the repl also uses it)

sfrieske commented 1 year ago

Thanks for the quick reply. The REPL works well for me, I like especially the easy import handling. It is a long awaited feature!