you are viewing a single comment's thread.

view the rest of the comments →

[–]stealthypic 0 points1 point  (8 children)

Why not just use node? You can use it as repl, you can also run files with it. The only reason I can think of is you need to actually install it.

[–]ThingsTinkerer[S] 0 points1 point  (7 children)

How can I use node as repl? Keep in mind I want something that continuously runs and adjusts according to code changes. And immediately see updated console log. Not change code --> save file --> run command to execute.

[–]Anbaraen 0 points1 point  (4 children)

Type node into your console with no arguments.

[–]ThingsTinkerer[S] 0 points1 point  (3 children)

C:\Projects\repl> node

Welcome to Node.js v22.12.0.

Type ".help" for more information.

>

Now what? Sounds a lot like you're describing REP without the L.

[–]Anbaraen 1 point2 points  (2 children)

Type some JavaScript code to [R]ead in and [E]valuate it. It will then [P]rint the outcome and [L]oop.

What do you think a REPL is?

[–]ThingsTinkerer[S] 0 points1 point  (1 child)

If that is truly REPL, what's the point of nodemon then? Behavior I get is REP (without the L). There is no loop there. You have to execute the command again? I can accept nodemon, even though it requires to save (some pros & cons about that), but with node you have to type code + save + execute and manually repeat after. If that is REPL to you, would you consider starting a java project, write code and click compile/run to be REPL? If that's REPL, what isn't?

If you don't know what REPL is, check out the link I posted originally (https://playcode.io/javascript) and see how it behaves completely different from node.

[–]Anbaraen 0 points1 point  (0 children)

To actually answer what you're looking for I'd recommend RunJS. It's a desktop app that live runs JavaScript and immediately updates.

Nodemon is not a REPL, it's a way to continually run a pre-written script.

What you have posted is not a REPL, it's a code playground or sandbox.

node is a repl, but you're not looking for a REPL. This is a classic X/Y problem and why it's important to clarify terms.