Running Javascript Standalone Engine?
Solution 1:
Check out Rhino or Spidermonkey. You might want to grab an implementation of the ServerJS standard, like Narwhal while you're at it.
Solution 2:
As for the engine - it's actually built in Windows itself and IE just uses it for webpages. Try it - you can make a simple .js
file and run it. It's a great replacement for .bat
files actually. :) You can also cscript.exe
(for console) and wscript.exe
(for windows app) to run your scripts. It's actually what Windows internally runs when you double-click a .js
file.
As for debugging - I don't know. I know that:
- Visual Studio supports script debugging, at least for browsers (but probably in other apps to that integrate with the Windows Scripting Host);
- There is a separate "Script Debugger" downloadable for free from Microsoft, though last I checked it was pretty crappy;
- The above mentioned
cscript.exe
andwscipt.exe
have command-line parameters that have something to do with script debugging, although I don't know what they do.
Solution 3:
You can also try out Google Chrome's JavaScript engine, V8:
http://code.google.com/p/v8/
Solution 4:
Rhino is an open-source implementation of JavaScript written entirely in Java.
Solution 5:
Many people here have recommended Rhino or other server-side implementations. But from what I read, you want something that should emulate the browser environment. In that regard, what I'd try (that means I haven't used this combination before) is Mozilla Rhino and env.js. While I've been using Mozilla Rhino for quite some time now, I can't say too much for env.js.
env.js is an emulation of the browser environment. It was originally developed by John Resig, but Chris Thatcher made it look as it is right now. Which in my opinion looks very promising. Haven't tried it before but I'd give it a chance.
Post a Comment for "Running Javascript Standalone Engine?"