Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Three JavaScript shells

DZone's Guide to

Three JavaScript shells

· Web Dev Zone ·
Free Resource

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

A JavaScript shell (interactive command line) is great for trying out stuff. Here are two ways to run one outside of a web browser:

  • Rhino: Download, unzip, go into its directory and type “java -jar js.jar”. Editing is limited, but you can fix that.
    • Help: help()
    • Better line editing: see section in “New in Rhino”.
    • Rhino 1.7R2 does not support ECMAScript 5, yet. You need to check out and build the latest version.
      • Check out: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/js/rhino
      • Go into directory: cd mozilla/js/rhino/
      • Built options: ant
      • Build jar: ant jar
  • node.js: Download, build and install (as explained on the website). Type “node” to start. Its editing is quite capable, it even shows properties if you hit Tab after the dot in input such as “obj.”.

Inside Firefox, I’ve had good experiences with the Firebug console which allows you to explore data structures by clicking on the output.

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}