
Show HN: Nodebook – Minimalist Node REPL with Web UI - netgusto
https://github.com/netgusto/nodebook
======
skibz
Very nice.

This reminds me of RunKit [1], which some of you may remember as TonicDev.

1: [https://runkit.com](https://runkit.com)

------
gitgud
Is this any better than the NodeJS kernel for Jupytr Notebooks?

[https://github.com/notablemind/jupyter-
nodejs](https://github.com/notablemind/jupyter-nodejs)

------
ZitchDog
This may be obvious, but do not under any circumstances run this application
on a public port! Any user will have complete access to your machine.

~~~
netgusto
Yes. By default, without --bindaddress specified, the server binds to
127.0.0.1 I'll add this warning to readme. Thanks.

~~~
zdwolfe
Any reason not to make the default safe?

~~~
netgusto
The default is to bind to `127.0.0.1`, which is safe (allow connexions from
the local host only).

------
jhomedall
I'm not seeing any CSRF tokens (but I don't generally work with node, so
correct me if I'm wrong).

If your POST endpoints accept application/x-www-form-urlencoded or
multipart/form-data, you will definitely want to add this. If you don't, it
becomes trivial to rig up a website that will use your browser to trigger a
POST to your internal endpoints.

------
emehrkay
I might fork this and add other Lang support. I like the minimal `write to a
file, eval, and display` approach. The execNotebook function would need
modifications

~~~
netgusto
Yes. Would probably require --docker and some predefined "run recipes" to
handle properly different languages, but seems very achievable.

~~~
emehrkay
A proper shebang would work for *nix users (and maybe Windows users as well).

I’d imagine a drop down next to the run button that would list the available
languages on the system. The code would need to check for the languages at
startup time and store a simple “lang.verson” => “/path/to/exe” map. And then
somehow use that when evaluating the code.

This is a cool little project that you have going.

------
romanovcode
I don't see the point if it is required by browser.

Another minimalist JS REPL powered by Chrome: Ctrl + Shift + J (Windows /
Linux) or Cmd + Opt + J (Mac).

~~~
netgusto
I made this to help with my brushing up for coding interviews.

I needed something like coderpad.io (that many companies use as a remote
interview tool anyway) but free, and that I could use on local files to keep
everything in a git repo.

Advantages that I see over the browser console you're suggesting:

* file persistence in a git repo

* uses an actual node instance

* capacity to use npm packages

* disposable environments for every execution (docker or node) so that your code is not polluted by previous runs

