Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a REPL like iPython for Nodejs? [closed]

Is there any kid of "repl + extra features" (like showing docs, module autoreload etc.), like iPython, but for Nodejs?

And I mean something that runs locally & offline. This is a must. And preferably to work both in terminal mode and have an optional nicer GUI on top (like iPython + iPythonQT/Jupyter-qtconsole).

The standard Nodejs repl is usable, but it has horrible usability (clicking the up-arrow cycles through the repl hisoty by line instead of by multi-line command, as you would expect any sane repl to work for interactively experimenting with things like class statements), and is very bare-bones. Every time I switch from iPython to it it's painful. A browser's repl like Chrome's that you can run for node too by starting a node-inspector debug session is more usable... but also too cumbersome.

like image 596
NeuronQ Avatar asked Feb 04 '17 11:02

NeuronQ


People also ask

Does node have a REPL?

Node. js has a standalone REPL accessible from the command line, and a built in REPL module you can use to create your own custom REPLs.

How do I close a node in REPL?

To exit from the REPL terminal, press Ctrl + C twice or write . exit and press Enter.

What does REPL stand for in Nodejs?

js Read-Eval-Print-Loop (REPL) is an interactive shell that processes Node. js expressions. The shell reads JavaScript code the user enters, evaluates the result of interpreting the line of code, prints the result to the user, and loops until the user signals to quit.


3 Answers

Use ijavascript.

This is compatible with Jupyter notebook and you can use it just like on Python environment.

The below is a screenshot taken from the official repository.

enter image description here

like image 180
Blaszard Avatar answered Oct 19 '22 14:10

Blaszard


I've been looking for "ipython for node" for years and here's how I would answer your question:

No.

like image 9
Rob Truxal Avatar answered Oct 19 '22 14:10

Rob Truxal


I wrote node-help for exactly this reason, maybe it would work for you? It pulls from the Node.js JSON API and works offline. Major versions 8,9 and 10 are supported.

There is no gui functionality for it, though, but I did take some care to make it easy on the eyes.

like image 2
foundling Avatar answered Oct 19 '22 12:10

foundling