Reputation: 33059
Is there any sort of interactive debugger for JavaScript? I'm imagining something like a web page on the left, and a REPL interface on the right.
Or maybe even without having a web page, so I can just play around with the JavaScript language.
Something that doesn't require I refresh the web page with breakpoints in Firebug or VS to examine locals and type code into a Watch window. Maybe I just need to learn Firebug better?
JavaScript doesn't have to be compiled, after all.
Kind of like LinqPad but for JavaScript maybe?
Anyone follow me here?
Upvotes: 53
Views: 19167
Reputation: 63688
Mancy is an open sourced, cross platform JavaScript REPL application. Its based on electron and react frameworks.
Some neat features:
Upvotes: 2
Reputation: 7348
LightTable lets you type in code and run it, and shows you the result inline.
Like this:
Upvotes: 2
Reputation: 3464
If you're on a Mac, OSX includes jsc
. Nothing new to install, just set up a link:
ln -s /System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc /usr/local/bin/jsc
Now you can start jsc
from a terminal. Type quit()
or CTRLC to get out.
Upvotes: 3
Reputation: 89527
repl.it supports REPL for number of languages, including JavaScript or you can try Codeacademy Labs it also has JavaScript REPL
Upvotes: 2
Reputation: 192447
Javascript REPL based on windows Script Host.
Also, there's a nice integration between that REPL and emacs.
Upvotes: 2
Reputation: 852
Not exactly REPL but another options for playing around with different libraries in javascript is Google's API playground:
https://code.google.com/apis/ajax/playground/
Upvotes: 0
Reputation: 4326
Node.js has a REPL.
On Mac OS X:
brew install node
node
.exit to exit the repl, .help for other options
http://nodejs.org/docs/v0.3.1/api/repl.html
Upvotes: 29
Reputation: 604
i use JSFiddle online (http://jsfiddle.net/) or seed in a linux terminal (http://live.gnome.org/Seed)
Upvotes: 3
Reputation: 765
I usually use Chrome's built in console. Even recent versions of IE have a decent dev tools window.
JRunscript is super cool (and I'm embarrassed I didn't know about it), but the issues I usually run into are due to variations in javascript implementation or DOM, not the language itself.
Upvotes: 1
Reputation: 390
For Chrome You can use jsshell - nice console:
https://chrome.google.com/extensions/detail/kmgmkbicahmbceidoidjbkbpkfogaldh
http://hugoware.net/projects/jsshell
Upvotes: 1
Reputation: 1449
Google Chrome has a very nice built-in Javascript console with great debugging and performance analysis functionalities.
Upvotes: 9
Reputation: 71
Just to provide another option, check out the shell bookmarklet here. I've been using it for years to run JavaScript against the currently loaded webpage.
The Firebug console is probably a little more feature-rich so I'm not sure there's any compelling reason to use this instead, but it may be a useful tool in some rare cases.
Upvotes: 5
Reputation: 8247
eloquent javascript's console at the bottom of the page seems to what you are looking for. Just click on the console label and a sliding console will emerge.
To allow you to try out programs, both the examples and the code you write yourself, this book makes use of something called a console. If you are using a modern graphical browser (Internet Explorer version 6 or higher, Firefox 1.5 or higher, Opera 9 or higher, Safari 3 or higher), the pages in this book will show a bar at the bottom of your screen. You can open the console by clicking on the little arrow on the far right of this bar.
Upvotes: 9
Reputation: 12793
To me, the most convenient debugger and REPL for JavaScript is Mozrepl. It is a Firefox/XULRunner extension that accesses the browser/application instance using telnet, and you can observe and manipulate everything in the browser; even the browser itself (remember, always talking about Firefox).
It is amazingly useful as a debugger (on standalone XUL applications it is the only bearable way to do real debugging) and as a tool to play around and understand the guts of your application, it speeds up your Javascript development time tenfold.
For an impressive demo of is possibilities, check out this video.
Upvotes: 10
Reputation: 71939
Stand-alone REPL (no browser/DOM, just JavaScript): JavaScript Shell from the Rhino project.
Upvotes: 23
Reputation: 69981
I've been using FireBug, i don't know if it is exactly what you need but i love debugging JavaScript through it.
Because you can print variables to its own console without having to always doing alert(var);
you can just do console.log(var)
Upvotes: 4
Reputation: 57168
The Safari 4 beta has this ability in the error console (in the "Develop" menu). It's especially cool because when it returns an object or HTML node, it lets you delve into it with a little reveal arrow, showing its members, contents, etc.
Upvotes: 3