Documentation
¶
Overview ¶
Command beastjs runs a JavaScript file in the engine of this module, set up as tifa sets it up, without writing Go:
beastjs [flags] file.js [args...] beastjs [flags] -e code [args...]
The script runs as a global script in one VM, then the promise jobs it queued. The VM has what package tifa gives it, as tifa gives it to each VM of its pool: Intl, Temporal, URL and URLSearchParams, and the functions named __tifa_* of tifa.Hooks. It also has Go's fmt as fmt, and calls may nest 10000 deep, as in tifa. The script also has print, console.log and console.error, which write their arguments, each made a string, to stdout (stderr for console.error), and scriptArgs, the arguments after the flags. It has no file system, network, timers or modules. The run ends at the timeout and at the memory limit whatever the script catches. docs/use/command.md has the exit codes and why the defaults are what they are.