Nodebook - Multi-Language REPL with Web UI + CLI code runner
Useful to practice algorithms and datastructures for coding interviews.
Nodebook is an in-browser REPL supporting many programming languages. Code's on the left, Console's on the right. Click "Run" or press Ctrl+Enter or Cmd+Enter to run your code. Code is automatically persisted on the file system.
You can also use Nodebook directly on the command line, running your notebooks upon change.
A notebook is a folder containing an {index|main}.{js,py,c,cpp,...}
file. The homepage lists all of the available notebooks.
(.c)
(.cpp)
(.cs)
(.clj)
(.ex)
(.fs)
(.go)
(.hs)
(.java)
(.js)
(.lua)
(.ml)
(.php)
(.py)
(.r, .R)
(.rb)
(.rs)
— Uses cargo run
if Cargo.toml
is present, and rustc
otherwise(.swift)
(.ts)
If --docker
is set on the command line, each of these environments will run inside a specific docker container.
Otherwise, the local toolchains will be used.
Head to Releases and download the binary built for your system (mac, linux).
Rename it to nodebook
and place it in your path.
Building requires go.
$ make deps
$ make install
# nodebook should be available under $GOPATH/bin/nodebook or $GOBIN/nodebook
# With dockerized toolchains
$ nodebook --docker path/to/notebooks
# With local toolchains
$ nodebook path/to/notebooks
$ nodebook cli --docker path/to/notebooks
# Or
$ nodebook cli path/to/notebooks
Click on the + Notebook button on the Home page, then select the language of the notebook to be created.
Once on the notebook edition page, you can rename the notebook by clicking on it's name.
Notebooks are created in the directory specified by the parameter --notebooks
.
In the directory where you want your notebooks to be stored, simply create a folder containing a file named {index|main}.{js,py,c,cpp,...}
.
The notebook's name will be the name of the folder. The notebook language is determined automatically.
false
Web UI only:
127.0.0.1
8000
If your notebook dir contains a .env
file, the corresponding environment will be set up during notebook execution.
Exemple .env
:
HELLO=World!
More information about the expected file format here: https://github.com/motdotla/dotenv#rules
Do not run the Web UI 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 connection from the localhost only. You can override the bind address using --bindaddress
, but do it only if you know what you're doing.