Expand description
A command-line interpreter and REPL for sljs.
It starts a REPL by default.
Multiple files can be specified to interpret.
Also, -e
takes a snippet from a commandline (can be specified multple times):
$ sljs -e 'var x = 12' -e 'x + x'
24
If you want to load some files/evaluate snippets and start REPL after that,
add -i
:
$ sljs ./fib.js -i
sljs> fib(20)
10946
Selecting a parser:
-E
,--esprima
selectEsprimaParser
-N
,--nodejs
selectNodejsParser
-J
,--json
selectJSONParser
(deserialization of JSON ESTree)- without flags: if
NodejsParser::NODE
works,NodejsParser
is used, otherwise it falls back toEsprimaParser
. Check the parser with--debug
.
Structs
Args 🔒