lukehaas / RunJS

RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
https://runjs.app
2.04k stars 44 forks source link

Feature Request: Run line/block of code #235

Open FOSSforlife opened 3 years ago

FOSSforlife commented 3 years ago

Coming from SuperCollider IDE, I'm looking into RunJS as an IDE for live coding, where I could make music and other art by writing JavaScript code on the fly. The one thing missing from RunJS is the ability to run a single line of code right where the cursor is using a keyboard shortcut. Right now it seems like you can only run the whole page of code at once.

Based on the SuperCollider workflow, it'd be nice to have:

lukehaas commented 3 years ago

This is an interesting idea, thanks for raising it. Will give it some thought 👍

mayorandrew commented 3 years ago

I was also thinking about a similar feature recently, so I would like to share my thoughts. For me, RunJS is a great improvement upon nodejs CLI REPL for running some quick JS code locally to do some stuff (like log analysis, etc).

Maybe RunJS could use code blocks like Jupyter or Observable.

I used Jupyter Notebooks in Python for some data analysis and would love to use the similar but simpler tooling for nodejs. There are nodejs kernel for Jupyter, but it requires some setup, and harder to launch than RunJS.

Observable is cool and very powerful, but it is cloud-only, so it is harder to work with large local files.

timuric commented 2 years ago

Hydrogen for Atom does it nicely, no need to tinker with the cells https://atom.io/packages/hydrogen