tawheed
tawheed

Reputation: 5821

Javascript REPL from the command line

Whenever I am coding, I often find myself every now and then in a REPL to test out some concepts before I go ahead and implement it. For Ruby on Rails development I use PRYand for python I use bpython. Wondering whether there is an equivalent for that in javascript. Basically testing out javascript code from the terminal

Upvotes: 7

Views: 1955

Answers (3)

Kendall Frey
Kendall Frey

Reputation: 44366

Even though I usually have a JavaScript-enabled browser open, I often find myself using the Node.js REPL.

Just run node in a command prompt, and it will open a REPL for you.

Upvotes: 11

Simon Boudrias
Simon Boudrias

Reputation: 44629

You just need to use node.js :

$ node
> 1 + 1
> 2
> 

Although, this won't work for usual browser element (window, document) and DOM. If you want a browser environnement, checkout Phantomjs REPL and Casperjs - although I'm not sure about their capacity.

Upvotes: 4

djechlin
djechlin

Reputation: 60788

Node.js offers a REPL, although you probably aren't looking to get into Node in general.

Upvotes: 0

Related Questions