34

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.

swatchai
  • 17,400
  • 3
  • 39
  • 58
NeuronQ
  • 7,527
  • 9
  • 42
  • 60
  • 1
    Have you looked at `nesh`? I used it as an alternative to `coffeescript's` own REPL several years ago. Keep in mind that much of the newest Ipython REPL feel comes from the new replacement for `readline`, `prompt_toolkit`. – hpaulj Feb 04 '17 at 18:52
  • 2
    `nesh` looks sweet, thx! for now I think I'll use `ijs` (jupyter notebook support for node - https://github.com/interactivecomputing/ijs) for when I need a "super repl" and nesh as a decent lightweight repl ...I imagine `ijs` is not very popular because JS folks don't have an already configured jupyter setup to run it, and scy oritented Pyrhon folks don't really admire nodejs, to put it mildly :) – NeuronQ Feb 06 '17 at 10:17
  • You could also use stdlib's REPL for Node.js, which can be found here: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/repl. This emulates IPython in look and feel, compared to the built-in Node.js REPL environment. – kgryte Feb 02 '21 at 22:39
  • I gave a talk on stdlib's REPL, which can be found here: https://skillsmatter.com/skillscasts/13369-a-better-node-js-repl. – kgryte Feb 02 '21 at 22:41

4 Answers4

16

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

Blaszard
  • 30,954
  • 51
  • 153
  • 233
  • 4
    It doesn't have autocomplete, unfortunately. – Soorena Nov 25 '18 at 19:13
  • Pretty cool but minus the autocomplete is a dealbreaker :( – SwimBikeRun May 23 '21 at 20:42
  • 1
    For TypeScript see: https://github.com/yunabe/tslab. Or any other Jupyter (evolution of IPython) kernel: https://github.com/jupyter/jupyter/wiki/Jupyter-kernels. It is available as VS Code extension: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter – nezort11 Sep 23 '22 at 07:14
9

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

No.

Rob Truxal
  • 5,856
  • 4
  • 22
  • 39
  • 1
    Is this true a year later? Python has both ipython and bpython which are far superior than the default CLI. I'm curious if anything that comes close exists. – Ehsan Kia Oct 27 '20 at 19:42
2

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.

foundling
  • 1,695
  • 1
  • 16
  • 22
-2

Give Data-Forge Notebook a try. (I'm not affiliated in any way.) https://www.data-forge-notebook.com/

JamesH
  • 75
  • 1
  • 4
  • @RoarS. what sort of 'relevant code' would you suggest for this question? I'd love to hear your suggestion. – JamesH Sep 04 '20 at 10:59
  • You didn't answer my question :) Answer: there is no relevant code to add. The context for the link ( Links may go away... ) was to include the name of the tool that clearly is relevant to the OP's question. I guess the point here is to not only close questions that don't meet guidelines but to chastise contributors that dare attempt providing useful answers to them. – JamesH Sep 04 '20 at 11:23