Search code examples
javascriptvbscriptwshjscript

Is there a local runtime environment for running Javascript? (like Windows Scripting Host for JScript)


I wonder if there is a 'local runtime environment' for hosting Javascript code, that's not browser based, for running small local apps? Something like WSH (Windows Scripting Host) for JavaScript (not MS-JScript).

I would like to run some javascript scripts locally, like I might for VBScript (VBS), with the possibility of some of the following:

  1. Access to local files (perhaps via an FSO object)
  2. Simple console read/write
  3. Recent version of Javascript
  4. Some form of simple debug

Alternatively, how might one consider running a browser in 'local' mode only? ie: launch, run-code, exit, perhaps with command-line switches/options, without too much overhead? If so, which browser? FireFox? Might it be possible to somehow 'extract' the JS runtime engine/DLL and call that?

So, in brief, something like WSH just for javascript?

Thanks.


Solution

  • http://nodejs.org/ gives you javascript running on V8.

    It runs on Mac, Linux and Windows and gives you access to a huge number of libraries in very rapid development using the Node Package Manager(NPM).

    If you want to do serverside/local javascript, this is what you should use and not some proprietary windows environment.