Interactive REPL for debugging Electron programs.
Run an electron program but also attach a REPL to the same context that your code runs in so you can inspect and mess with stuff as your program is running!
This is alpha quality and not guaranteed to work with complex programs! Please report issues and contribute fixes if you can.
Currently this only works with the
main electron process -- relative requires don't work in the
renderer thread and things just explode in there. If you think you know a fix please let us know!
$ npm i -g electron-repl $ electron-repl Usage: electron-repl <filename> $ electron-repl your-program.js >
If you have
firstname.lastname@example.org+ installed, you can just do:
$ npx electron-repl your-program.js >
Suppose we have a program called
hello.js that has these contents:
var pizza = 1
If you run
electron-repl hello.js you will get a REPL, just like when you run
The difference is that this REPL is running in the same context as your program.
$ electron-repl hello.js > 1 + 1 // we are in an electron repl 2 > pizza // we can access variables in our program 1 >
Contributions welcome! Please read the contributing guidelines first.