Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| util:jsexec [2010/02/26 14:23] – Links to util:scfg changed to util:scfg:index digitalman | util:jsexec [2022/03/06 15:19] (current) – [Module] Add Log Level section digital man | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== JSexec ====== | ====== JSexec ====== | ||
| + | |||
| + | JSexec may be used to execute some Synchronet JavaScript files (e.g. '' | ||
| + | |||
| + | ===== Uses ===== | ||
| + | * Persistent execution of static services (e.g. [[: | ||
| + | * Background execution of timed events (e.g. [[: | ||
| + | * Command-line execution of sysop functions (e.g. [[: | ||
| + | * [[: | ||
| + | |||
| + | ===== Independence ===== | ||
| + | |||
| + | A Synchronet installation is required for JSexec to function, though JSexec will execute scripts successfully even when Synchronet is not running. | ||
| + | |||
| + | ===== Command Line ===== | ||
| + | |||
| + | < | ||
| + | usage: jsexec [-opts] [[path/ | ||
| + | or: jsexec [-opts] -r js-expression [args] | ||
| + | or: jsexec -v | ||
| + | |||
| + | available opts: | ||
| + | |||
| + | -r< | ||
| + | -c< | ||
| + | -C do not change the current working directory (to CTRL dir) | ||
| + | -d run in background (daemonize) | ||
| + | -m< | ||
| + | -t< | ||
| + | -y< | ||
| + | -g< | ||
| + | -h[hostname] | ||
| + | -u< | ||
| + | -L< | ||
| + | -E< | ||
| + | -i< | ||
| + | -f use non-buffered stream for console messages | ||
| + | -a | ||
| + | -A send all messages to stdout | ||
| + | -A< | ||
| + | -e< | ||
| + | -o< | ||
| + | -S< | ||
| + | -S send status messages to stdout | ||
| + | -n send status messages to /dev/null instead of stderr | ||
| + | -q send console messages to /dev/null instead of stdout | ||
| + | -v | ||
| + | -x | ||
| + | -l loop until intentionally terminated | ||
| + | -p wait for keypress (pause) on exit | ||
| + | -! wait for keypress (pause) on error | ||
| + | -D load the script into an interactive debugger | ||
| + | </ | ||
| + | |||
| + | ==== Module ==== | ||
| + | The '' | ||
| + | |||
| + | **Note:** | ||
| + | When JSexec starts up, it changes its **current working directory** to the Synchronet '' | ||
| + | |||
| + | ==== Log Level ==== | ||
| + | |||
| + | The log severity/ | ||
| + | ===== Additional Properties ===== | ||
| + | |||
| + | Additional properties available to JavaScript scripts running from JSexec: | ||
| + | |||
| + | ^Property | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |||
| + | ===== Additional Functions ===== | ||
| + | |||
| + | The following global methods (functions) are also available to JavaScript scripts running from JSexec: | ||
| + | |||
| + | ^Function | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | |'' | ||
| + | ===== conio ===== | ||
| + | JSexec includes an instance of a special Console Input/ | ||
| FIXME | FIXME | ||
| + | ===== uifc ===== | ||
| + | JSexec includes an instance of a special User Interface class called '' | ||
| + | |||
| + | See the [[ref: | ||
| + | |||
| + | ===== shebang ===== | ||
| + | |||
| + | JSexec for non-Windows platforms will ignore the first line of the interpreted script if it begins with ''# | ||
| + | < | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | This allows JSexec scripts to be executed easily via [[: | ||
| + | |||
| + | ===== Output ===== | ||
| + | |||
| + | JSexec supports multiple output methods and streams: | ||
| + | |||
| + | - **Error** (default stream: '' | ||
| + | - **Status** (default stream: '' | ||
| + | - **Console** (default stream: '' | ||
| + | |||
| + | ==== syslog ==== | ||
| + | |||
| + | When JSexec is executed on *nix operating systems with the '' | ||
| + | |||
| + | ==== Suppression ==== | ||
| + | * **Status** output is suppressed by default when JSexec is run without a controlling TTY. This behavior can be overridden with the '' | ||
| + | * **Status** output can be manually suppressed with the '' | ||
| + | * **Console** output can be suppressed with the '' | ||
| + | |||
| + | ==== Redirection ==== | ||
| + | * The output streams may be redirected to specific filenames via command-line options. | ||
| + | * **Error** output can be forked to both '' | ||
| ===== See Also ===== | ===== See Also ===== | ||
| - | * [[.:scfg:index|Utilities]] | + | * [[custom: |
| + | * [[: | ||
| + | * [[: | ||
| + | * [[:util: | ||
| + | {{tag> | ||