For instance, if you were to run a Python script you would type python filename.py or if you wanted to run a C program make filename then ./ filename>
This is a "roundabout" solution but you could use ipython
Start ipython notebook from terminal:
$ ipython notebook
It will open in a browser where you can run the javascript