2016-10-02 12:50:29 +00:00
|
|
|
# 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.
|
|
|
|
|
2016-10-02 18:12:37 +00:00
|
|
|
The `repl` module provides a REPL implementation that can be accessed using:
|
2016-10-02 12:50:29 +00:00
|
|
|
|
|
|
|
* Assuming you have `electron` or `electron-prebuilt` installed as a local
|
|
|
|
project dependency:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
./node_modules/.bin/electron --interactive
|
|
|
|
```
|
2020-11-05 22:12:43 +00:00
|
|
|
|
2016-10-02 12:50:29 +00:00
|
|
|
* Assuming you have `electron` or `electron-prebuilt` installed globally:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
electron --interactive
|
|
|
|
```
|
2016-10-03 18:42:25 +00:00
|
|
|
|
2016-10-04 14:02:46 +00:00
|
|
|
This only creates a REPL for the main process. You can use the Console
|
2016-10-03 18:42:25 +00:00
|
|
|
tab of the Dev Tools to get a REPL for the renderer processes.
|
|
|
|
|
2016-10-06 18:38:09 +00:00
|
|
|
**Note:** `electron --interactive` is not available on Windows.
|
2016-10-04 14:02:46 +00:00
|
|
|
|
2016-10-06 18:38:09 +00:00
|
|
|
More information can be found in the [Node.js REPL docs](https://nodejs.org/dist/latest/docs/api/repl.html).
|