Minimal and editor agnostic Node.js REPL/Scratchpad with watch and debugging.
You can install other npm packages and use them with the require
syntax.
In your terminal:
git clone https://github.com/watofundefined/poor-mans-jsrepl.git
cd poor-mans-jsrepl
npm i
npm run repl
Open your favourite editor and make a change inside the index.js
.
For example add a new line hello ("<Your-Name-Here>")
Save
You should see your name printed in terminal.
You can uncomment the // boom()
line and save to see how errors look like (should be red).
- On command line
npm run repl:d
- Open Chrome or Chromium based browser (Brave, etc.)
- Press
Ctrl+Shift+I
to open dev tools - You should see a green Node.js logo in the top left of the dev tools, Click it
- That should open a new window and you can debug your code
Debugging works with future watch rebuilds too. Just make sure that you let the script complete in the debugger window before saving your file again - otherwise the debugger won't restart.
VSCode has amazing Quokka.js which I used to use but VScode makes my laptop sweat so I prefer more lightweight editors. After I spent 30mins trying to explain Sublime's Quokka plugin where to look for the Node.js binary managed by nvm I gave up and made this.