7

In OSX there is a hidden utility called jsc, part of WebKit, that can be used to run JavaScript code on the command line. It can be used as a JavaScript console, like irb for Ruby.

I have the libwebkitgtk-3.0 and -3.0-dev libraries installed, but I cannot figure out how to find or build jsc. Is it even possible?

Note: I already know about alternatives like Rhino, SpiderMonkey, etc.

3 Answers3

9

Install a link to install rhino and use rhino-jsc (see manpage)

3

Another solution is to install nodejs:

sudo apt-get install nodejs npm

The above will not always install the most recent version, in which case you can try:

sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
ccalvert
  • 131
2

If you prefer to avoid Rhino and stick with the WebKitGTK+ packages, install a link to install libjavascriptcoregtk and use /usr/bin/jsc (manpage)