Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm a sucker for javascript, and i'm increasingly drawn towards writing script utilities for my everyday needs.

Currently I writing these utilities in bash scripts, but i'm not so proficient with shell scripting. I'm wondering if

  • any of you have ever come across an interpreter for javascript
  • any other convenient language that you use to write script utlitities in (like csh/perl)

[migrated from p.se]

I got one answer on p.se about Rhino. Is there anyway to run spidermonkey as a js interpreter on linux (and optionally windows)?

share|improve this question
    
I know that V8 has been used to create server-run instances of javascript apps, an example being Node.js. Maybe see how Node.js is invoked...? –  Jonathan Oct 13 '10 at 9:39

3 Answers 3

It is definitely possible to run SpiderMonkey at the command line. Fedora for one includes it in the js package, and there is documentation that shows how to build it.

Do note that XML and DOM handling is actually provided by the browser, and you'll need something like XML for <SCRIPT> if you want to use them at the command line.

I still prefer Python or Bash scripts whenever appropriate though.

share|improve this answer

You may look at javascript-interpreter-to-replace-python question from stackoverflow. Personally I would rather use Python/Ruby for system scripting.

share|improve this answer

try NodeJs

It has loads or modules to help writing scripts to run on command line. Here is one of the library that can be used to write task based command line tools.

https://github.com/cowboy/grunt

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.