<p>For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online <a href="http://www.squarefree.com/shell/" rel="nofollow noreferrer">JavaScript Shell</a> is really nice, but I'm looking for something local, without the need for an browser.</p>

<p>So far I have tested the standalone JavaScript interpreter rhino, spidermonkey and google V8. But neither of them has completion. At least Rhino with jline and spidermonkey have some kind of command history via key up/down, but nothing more.</p>

<p>Any suggestions?</p>

<p>This question was asked again <a href="https://stackoverflow.com/questions/260787/javascript-shell">here</a>.  It might contain an answer that you are looking for.</p>

[{'answer_id': 41259, 'author': 'Jasper', 'author_id': 1184, 'author_profile': 'https://Stackoverflow.com/users/1184', 'pm_score': 2, 'selected': False, 'text': '<p>Isn\'t <a href="http://developer.mozilla.org/en/Rhino_Shell" rel="nofollow noreferrer">Rhino Shell</a> what you are looking for?</p>\n'}, {'answer_id': 41415, 'author': 'Sam Hasler', 'author_id': 2541, 'author_profile': 'https://Stackoverflow.com/users/2541', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://ejohn.org/blog/javascript-engine-speeds/" rel="nofollow noreferrer">This post</a> by John Resig says that there are shells for <a href="http://www.mozilla.org/projects/tamarin/" rel="nofollow noreferrer">Tamarin (Firefox 4?)</a> and <a href="http://webkit.org/projects/javascript/index.html" rel="nofollow noreferrer">JavaScriptCore (Safari 3)</a>. I\'m not sure if they have auto completion though.</p>\n'}, {'answer_id': 747082, 'author': 'Martin Lazar', 'author_id': 82569, 'author_profile': 'https://Stackoverflow.com/users/82569', 'pm_score': 5, 'selected': True, 'text': '<p>Rhino Shell since 1.7R2 has support for completion as well. You can find more information <a href="http://blog.norrisboyd.com/2009/03/rhino-17-r2-released.html" rel="noreferrer">here</a>.</p>\n'}, {'answer_id': 1812416, 'author': 'Cheeso', 'author_id': 48082, 'author_profile': 'https://Stackoverflow.com/users/48082', 'pm_score': 3, 'selected': False, 'text': '<p>In Windows, you can run this file from the command prompt in cscript.exe, and it provides an simple interactive shell.  No completion.</p>\n\n<pre><code>// shell.js\n// ------------------------------------------------------------------\n//\n// implements an interactive javascript shell.\n//\n// from\n// http://kobyk.wordpress.com/2007/09/14/a-jscript-interactive-interpreter-shell-for-the-windows-script-host/\n//\n// Sat Nov 28 00:09:55 2009\n//\n\nvar GSHELL = (function () {\n\n    var numberToHexString = function (n) {\n        if (n &gt;= 0) {\n            return n.toString(16);\n        } else {\n            n += 0x100000000;\n            return n.toString(16);\n        }\n    };\n    var line, scriptText, previousLine, result;\n\n    return function() {\n        while(true) {\n            WScript.StdOut.Write("js&gt; ");\n            if (WScript.StdIn.AtEndOfStream) {\n                WScript.Echo("Bye.");\n                break;\n            }\n            line = WScript.StdIn.ReadLine();\n            scriptText = line + "\\n";\n            if (line === "") {\n                WScript.Echo(\n                    "Enter two consecutive blank lines to terminate multi-line input.");\n                do {\n                    if (WScript.StdIn.AtEndOfStream) {\n                        break;\n                    }\n                    previousLine = line;\n                    line = WScript.StdIn.ReadLine();\n                    line += "\\n";\n                    scriptText += line;\n                } while(previousLine != "\\n" || line != "\\n");\n            }\n            try {\n                result = eval(scriptText);\n            } catch (error) {\n                WScript.Echo("0x" + numberToHexString(error.number) + " " + error.name + ": " +\n                             error.message);\n            }\n            if (result) {\n                try {\n                    WScript.Echo(result);\n                } catch (error) {\n                    WScript.Echo("&lt;&lt;&gt;&gt;");\n                }\n            }\n            result = null;\n        }\n    };\n})();\n\nGSHELL();\n</code></pre>\n\n<p>If you want, you can augment that with other utility libraries, with a .wsf file.  Save the above to "shell.js", and save the following to "shell.wsf": </p>\n\n<pre><code>&lt;job&gt;\n    &lt;reference object="Scripting.FileSystemObject" /&gt;\n    &lt;script language="JavaScript" src="util.js" /&gt;\n    &lt;script language="JavaScript" src="shell.js" /&gt;\n&lt;/job&gt;\n</code></pre>\n\n<p>...where util.js is: </p>\n\n<pre><code>var quit = function(x) { WScript.Quit(x);}\nvar say = function(s) { WScript.Echo(s); };\nvar echo = say;\nvar exit = quit;\nvar sleep = function(n) { WScript.Sleep(n*1000); };\n</code></pre>\n\n<p>...and then run shell.wsf from the command line.  </p>\n'}, {'answer_id': 4074237, 'author': 'intuited', 'author_id': 192812, 'author_profile': 'https://Stackoverflow.com/users/192812', 'pm_score': 3, 'selected': False, 'text': '<p><strong>edit</strong>: after using the node REPL a bit more, I\'ve discovered this evaluation to be overly positive.  There are some serious problems with its implementation, including an inability to yank killed text, issues with editing lines that are longer than the terminal width, and some other problems.  It might be better to just use rhino.</p>\n\n<p>The <a href="http://nodejs.org/" rel="nofollow">node.js</a> <a href="http://en.wikipedia.org/wiki/REPL" rel="nofollow">REPL</a> (<code>node-repl</code> on a system with node installed) is the best terminal-based, system-context shell I\'ve seen so far.  I\'m comparing it to rhino and the built-in v8 shell.  It provides tab-completion and line editing history, as well as syntax-colouring of evaluations.  You can also import <a href="http://commonjs.org/" rel="nofollow">CommonJS</a> modules, or at least those modules implemented by node.</p>\n\n<p>Downside is that you have to build node.  This is not a huge deal, as building apps goes, but might be a challenge if you don\'t normally do such things.</p>\n'}, {'answer_id': 5537664, 'author': 'Franck Freiburger', 'author_id': 138579, 'author_profile': 'https://Stackoverflow.com/users/138579', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://code.google.com/p/jslibs/" rel="nofollow">jslibs</a> (a standalone javascript runtime) could also be suitable for this purpose.</p>\n'}]
['https://Stackoverflow.com/questions/41207', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/720/']