Javascript as a command line language invoked by a script

I am looking for a way to write some simple scripts in javascript, like in ruby. For example, I could write a script like:

var str = "Hello World";
console.log(str);

And I want to call it from my command line as follows:

js hello_world.js

Is there some kind of Javascript runtime that includes a standard library that would allow me to make this script development style? I know there is node.js, but this is specific to the web server, right?

+3
source share
6 answers

Node.js was the clear winner here, at least for me.

http://nodejs.org/

+5
source

, Rhino, Javascript, Java. , JavaScript.

, .

0

modilla spidermonkey?

apt-cache search javascript interpreter
spidermonkey-bin - standalone JavaScript/ECMAScript (ECMA-262) interpreter
libjenkins-htmlunit-core-js-java - Jenkins branch of the HtmlUnit Core JS Interpreter
gnome-js-common - Common modules for GNOME JavaScript interpreters
0

Phantom JS javascript , DOM, CSS Selector JSON.

0

javascript? , , Perl? Javascript - .

-1

Source: https://habr.com/ru/post/1786060/


All Articles