n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.19k stars 185 forks source link

Hide execution result when code terminated by ; #246

Closed wei3erHase closed 2 years ago

wei3erHase commented 3 years ago

Every Jupyter cell has an output, no matter if the user decides to have that output or not. The output is represented by the last line of each cell, even when ; is used. Is there a way to avoid automatic outputs? To allow them only when no ; is used on the last line?

n-riesco commented 3 years ago

By default, IJavascript behaves as the Node.js CLI does.

There are a few command flags to customise this behaviour. Probably, not what you're after:

There is also the flag --startup-script=path (to run a script on kernel startup; path can be a file or a folder), that lets you customise IJavascript behaviour further.

This approach has been used successfully by https://www.npmjs.com/package/magicpatch. See this comment for a pointer to the relevant code. If you decide to go this route and you need more help, please, let me know.