Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
util:jsexec [2010/04/15 14:23] – Links to custom:js changed to custom:javascript digitalman | util:jsexec [2018/01/10 02:31] – Add additional Properties (stdio) and Functions digital man |
---|
Additional properties available to JavaScript scripts running from JSexec: | Additional properties available to JavaScript scripts running from JSexec: |
| |
^Property ^Type ^Description^ | ^Property ^ Type ^Description^ |
|''jsexec_revision'' |string|[[dev:CVS]] revision of JSexec (example: ''%%"1.135"%%'')| | |''jsexec_revision'' |string|[[dev:CVS]] revision of JSexec (example: ''%%"1.135"%%'')| |
|''jsexec_revision_detail'' |string |Verbose details about the JSexec build (example: ''%%"JSexec 1.136 Debug Compiled Mar 15 2010 11:13:53 with GCC 3.4.2"%%'')| | |''jsexec_revision_detail'' |string |Verbose details about the JSexec build (example: ''%%"JSexec 1.136 Debug Compiled Mar 15 2010 11:13:53 with GCC 3.4.2"%%'')| |
|''env'' |string[] |Associative array of system environment variables (example: ''%%env["shell"]="/bin/bash"%%'')| | |''env'' | Object |Associative array of system environment variables (example: ''%%env["shell"]="/bin/bash"%%'')| |
| |''stdin'' | File |Standard input stream | |
| |''stdout'' | File |Standard output stream | |
| |''stderr'' | File |Standard error output stream | |
| |
| ===== Additional Functions ===== |
| |
| The following global methods (functions) are also available to JavaScript scripts running from JSexec: |
| |
| ^Function ^ Return Value ^ Description ^ |
| |''log'' | String | Log a message | |
| |''read'' | String | Read from stdin | |
| |''readln'' | String | Read line from stdin | |
| |''write'' | String | Write a string to stdout | |
| |''print'' | String | Write a line to stdout (a.k.a. ''writeln'') | |
| |''printf'' | String | Write a formatted string to stdout | |
| |''alert'' | String | Print an alert message on the console | |
| |''prompt'' | String | Prompt for user input | |
| |''confirm'' | String | Get a yes/no confirmation | |
| |''deny'' | String | Get a no/yes confirmation | |
| |''chdir'' | String | Change the current working directory | |
| |''putenv'' | String | Add or change an environment variable | |
===== conio ===== | ===== conio ===== |
JSexec includes an instance of a special Console Input/Output class called ''conio''. | JSexec includes an instance of a special Console Input/Output class called ''conio''. |