curl -sSL https://runjs.cc/install.sh | sh
–OR–
wget https://runjs.cc/install.sh && sh install.sh
Get file and run it:
https://runjs.cc/localinstall.sh
$ runjs
runjs - Run JSSP-JS script.
ERROR: NO arguments assigned!
CMD: runjs file.js | -u url | -s script | -i | -I
OR : runjs-debug file.js | -u url | -s script | -i | -I
file.js assign script file name
-u url assign url name
-s script assign script content
-i interactive
-I standard input
$ runjs -i
script> println('Hello World.');
Hello World.
+ Result: null
script> exit()
+ Bye!
$ echo 'println("Hello World.")' | runjs -I
Hello World.
$ curl -sSL https://runjs.cc/helloworld.js | runjs -I
Hello: hatterjiang
$ runjs -I <<< "
xprintln('[OK] SUCCESS!');
"
$ runjs -I << EOF
xprintln('Hello World!');
EOF
$ cat f.js
var main = () => {
println("Hello World!");
};
main();
$ runjs f.js
Hello World!
$ cat f.js
var main = () => {
$ARRAY($$.file($$.env('HOME')).list())
.filter((f) => { return f.startsWith('hatter') })
.filter((f) => { return f.endsWith('.asc') })
.forEach((f) => { println(f) });
};
main();
$ runjs f.js
hatter_pgp_2048_c.asc
hatterpubkey4096.asc
$ cat aes.js
#! /usr/bin/env runjs
var AESCrypt = Packages.me.hatter.tools.commons.security.crypt.AESCrypt;
var main = () => {
AESCrypt.main($ARGS);
};
main();