

GitHub - netgusto/nodebook: Nodebook - Minimalist Node REPL with web UI...
source link: https://github.com/netgusto/nodebook
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
nodebook
Nodebook - Minimalist Node REPL with web UI
What is it?
It's an in-browser REPL for Node.
Code's on the left, Console on the right. Click "Run" or press Ctrl+Enter or Cmd+Enter to run your code. The code is automatically persisted on the file system.
The home lists the available Nodebooks. A Nodebook is a folder containing an index.js
file.
Installation
$ git clone https://github.com/netgusto/nodebook
$ cd nodebook
$ npm install
Usage
Create a Nodebook
In a directory where your Nodebooks will be stored, simply create a folder containing a file named index.js
.
The dir name will be the nodebook name.
Run the REPL
# Default usage; local execution, bound to 127.0.0.1:8000 $ node . --notebooks path/to/notebooks # open http://127.0.0.1:8000 in a browser
# Set bindaddress and port $ node . --notebooks path/to/notebooks --bindaddress 0.0.0.0 -port 12000
# Execute code in disposable docker containers (node:alpine) $ node . --notebooks path/to/notebooks --docker
Command line options
- --notebooks: path to notebook folders; required
- --bindaddress: IP address the http server should bind to; defaults to
127.0.0.1
- --port: Port used by the application; defaults to
8000
- --docker: Execute code in disposable docker containers instead of local system's Node; defaults to
false
⚠️ A bit of warning ⚠️
Do not run this on a port open to public traffic! Doing so would allow remote code execution on your machine.
By default, the server binds to 127.0.0.1
, which allows connexion from the localhost only. You can override the bind address using --bindaddress
, but do it only if you know what you're doing.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK