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'
24If you want to load some files/evaluate snippets and start REPL after that,
add -i:
$ sljs ./fib.js -i
sljs> fib(20)
10946Selecting a parser:
-E,--esprimaselectEsprimaParser-N,--nodejsselectNodejsParser-J,--jsonselectJSONParser(deserialization of JSON ESTree)- without flags: if
NodejsParser::NODEworks,NodejsParseris used, otherwise it falls back toEsprimaParser. Check the parser with--debug.
Structs
Args 🔒