electron/docs/tutorial/repl.md
trop[bot] 615b65b2a2
docs: unify [!NOTE] structure (#47047)
* docs: unify [!NOTE] structure

Co-authored-by: Erick Zhao <ezhao@slack-corp.com>

* Update docs/api/command-line.md

Co-authored-by: Niklas Wenzel <dev@nikwen.de>

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* Update docs/api/browser-window.md

Co-authored-by: Niklas Wenzel <dev@nikwen.de>

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* Update docs/api/download-item.md

Co-authored-by: Niklas Wenzel <dev@nikwen.de>

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* Update docs/api/global-shortcut.md

Co-authored-by: Niklas Wenzel <dev@nikwen.de>

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* revert line break

Co-authored-by: Erick Zhao <ezhao@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <ezhao@slack-corp.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2025-05-09 17:45:54 -05:00

986 B

REPL

Read-Eval-Print-Loop (REPL) is a simple, interactive computer programming environment that takes single user inputs (i.e. single expressions), evaluates them, and returns the result to the user.

Main process

Electron exposes the Node.js repl module through the --interactive CLI flag. Assuming you have electron installed as a local project dependency, you should be able to access the REPL with the following command:

./node_modules/.bin/electron --interactive

Note

electron --interactive is not available on Windows (see electron/electron#5776 for more details).

Renderer process

You can use the DevTools Console tab to get a REPL for any renderer process. To learn more, read the Chrome documentation.