# Synchronet JavaScript Object Model Reference

Generated for Synchronet v3.21c, master/be01fc46b0 (Feb 25 2026 02:57) compiled Feb 25 2026 03:04

- Property and Method version numbers (when available) indicate the Synchronet version when the item was added or modified.
- Optional method arguments are specified in `[brackets]` in the 'Usage' column.
- Method argument types (e.g. bool, string, number, object), when significant, are specified in `italics` in the 'Usage' column.
- Methods documented as returning 'void' will always return `undefined`.
- Methods documented as returning 'undefined' may return one of multiple value types.

1. [+] global object
   - methods
   - properties
2. [+] js object
   - methods
   - properties
3. [+] system object
   - methods
   - properties
   - system.stats object
     - properties
   - system.node_list array
     - properties
4. [+] server object
   - properties
5. [+] client object
   - properties
6. [+] bbs object
   - methods
   - bbs.mods object
   - properties
7. [+] console object
   - methods
   - properties
8. [+] msg_area object
   - properties
   - msg_area.grp object
   - msg_area.sub object
   - msg_area.grp_list array
     - properties
     - msg_area.grp_list.sub_list array
       - properties
9. [+] file_area object
   - properties
   - file_area.lib object
   - file_area.dir object
   - file_area.lib_list array
     - properties
     - file_area.lib_list.dir_list array
       - properties
10. [+] xtrn_area object
    - xtrn_area.sec object
    - xtrn_area.prog object
    - xtrn_area.sec_list array
      - properties
      - xtrn_area.sec_list.prog_list array
        - properties
    - xtrn_area.event object
      - properties
    - xtrn_area.editor object
      - properties
11. [+] User class
    - methods
    - properties
    - User.stats object
      - properties
    - User.security object
      - properties
    - User.limits object
      - properties
12. [+] MsgBase class
    - methods
    - properties
    - MsgBase.cfg object
      - properties
    - MsgBase class object
      - MsgBase.IndexPrototype object
      - MsgBase.HeaderPrototype object
13. [+] FileBase class
    - methods
    - properties
    - FileBase class object
      - FileBase.DETAIL object
        - properties
      - FileBase.SORT object
        - properties
14. [+] File class
    - methods
    - properties
15. [+] Archive class
    - methods
    - properties
    - Archive class object
      - properties
16. [+] Queue class
    - methods
    - properties
17. [+] Socket class
    - methods
    - properties
    - Socket class object
      - properties
18. [+] ConnectedSocket class
19. [+] ListeningSocket class
20. [+] MQTT class
    - methods
    - properties
21. [+] COM class
    - methods
    - properties
22. [+] conio object
    - methods
    - properties
23. [+] CryptContext class
    - methods
    - properties
    - CryptContext class object
      - CryptContext.ALGO object
        - properties
      - CryptContext.MODE object
        - properties
24. [+] CryptKeyset class
    - methods
    - CryptKeyset class object
      - CryptKeyset.KEYOPT object
        - properties
25. [+] CryptCert class
    - methods
    - properties
    - CryptCert class object
      - CryptCert.CURSOR object
        - properties
      - CryptCert.TYPE object
        - properties
      - CryptCert.FORMAT object
        - properties
      - CryptCert.ATTR object
        - properties
26. [+] uifc object
    - methods
    - properties

## global object
Top-level functions and properties (common to all servers, services, and JSexec) - introduced in v3.10

`global` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
log | string | `log([number level=LOG_INFO,] value [,value])` | 3.11 | Add a line of text to the server and/or system log. values are typically string constants or variables (each logged as a separate log message), level is the severity of the message to be logged, one of the globally-defined values, in decreasing severity: `LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG` (default: `LOG_INFO`)
read | string | `read([count=128])` | 3.11 | Read up to `count` characters from input stream and return as a string or `undefined` upon error
readln | string | `readln([count=128])` | 3.11 | Read a single line, up to `count` characters, from input stream and return as a string or `undefined` upon error
write | void | `write(value [,value])` | 3.11 | Send one or more values (typically strings) to the output stream
write_raw | void | `write_raw(value [,value])` | 3.14 | Send a stream of bytes (possibly containing NUL or special control code sequences) to the output stream
writeln | void | `writeln(value [,value])` | 3.11 | Send a line of text to the output stream with automatic line termination (CRLF), values are typically string constants or variables (AKA print)
printf | string | `printf(string format [,value][,value])` | 3.10 | Send a C-style formatted string of text to the output stream. See also the `format()` function.
alert | void | `alert(value)` | 3.10 | Send an alert message (ala client-side JS) to the output stream
prompt | string | `prompt([string text] [,string value] [,number k_mode=K_EDIT])` | 3.10 | Display a prompt (`text`) and return a string of user input (ala client-side JS) or `null` upon no-input `value` is an optional default string to be edited (used with the `k_mode K_EDIT` flag) See `sbbsdefs.js` for all valid `K_` (keyboard-input) mode flags.
confirm | boolean | `confirm(value)` | 3.10 | Display a Yes/No prompt and return `true` or `false` based on user's confirmation (ala client-side JS, `true` = yes) see also `console.yesno()```
deny | boolean | `deny(value)` | 3.15b | Display a No/Yes prompt and returns `true` or `false` based on user's denial (`true` = no) see also `console.noyes()```
exit | void | `exit([number exit_code=0])` | 3.11 | Stop script execution, optionally setting the global property `exit_code` to the specified numeric value
load | undefined | `load([bool background or object scope,] string filename [,args])` | 3.12 | Load and execute a JavaScript module (filename), optionally specifying a target scope object (default: this) and a list of arguments to pass to the module (as argv). Returns the result (last executed statement) of the executed script or a newly created Queue object if background is `true`). Background: When the background parameter is `true`, the loaded script runs in the background (in a child thread) but may communicate with the parent script/thread by reading from and/or writing to the parent_queue (an automatically created Queue object). The result (last executed statement) of the executed script (or the optional exit_code passed to the exit() function) will be automatically written to the parent_queue which may be read later by the parent script (using load_result.read(), for example).
require | undefined | `require([object scope,] string filename, propname [,args])` | 3.17 | Load and execute a JavaScript module (filename), optionally specifying a target scope object (default: this) and a list of arguments to pass to the module (as argv) IF AND ONLY IF the property named propname is not defined in the target scope (a defined symbol with a value of undefined will not cause the script to be loaded). Returns the result (last executed statement) of the executed script or null if the script is not executed.
mswait | number | `mswait([milliseconds=1])` | 3.13 | Pause execution for the specified number of milliseconds (AKA sleep), returns elapsed duration, in seconds
yield | void | `yield([forced=true])` | 3.11 | Release current thread time-slice, a forced yield will yield to all other pending tasks (lowering CPU utilization), a non-forced yield will yield only to pending tasks of equal or higher priority. forced defaults to `true`
random | number | `random([max_number=100])` | 3.10 | Return random integer between `0` and max_number-1
time | number | `time()` | 3.10 | Return current time and date in Unix (time_t) format (number of seconds since January 1st, 1970 UTC)
beep | void | `beep([frequency=500] [,duration=500])` | 3.10 | Produce a tone on the local speaker at specified frequency for specified duration (in milliseconds)
sound | boolean | `sound([filename])` | 3.10 | Play a waveform (.wav) sound file (currently, on Windows platforms only)
ctrl | string | `ctrl(number or string value)` | 3.11 | Return ASCII control character representing character value passed - Example: `ctrl('C')` returns string containing the single character string: `'\3'`
ascii | undefined | `ascii([string text] or [number value])` | 3.10 | Convert single character to numeric ASCII value or vice-versa, returns number OR string, or `null` or `undefined` if passed those values
ascii_str | string | `ascii_str(text)` | 3.10 | Convert extended-ASCII (CP437) characters in text string to plain US-ASCII equivalent, returns modified string or `null` or `undefined` if passed those values
strip_ctrl | string | `strip_ctrl(text)` | 3.10 | Strip all control characters and Ctrl-A (attribute) sequences from string, returns modified string or `null` or `undefined` if passed those values
strip_ctrl_a | string | `strip_ctrl_a(text)` | 3.20 | Strip all Ctrl-A (attribute) sequences from string, returns modified string or `null` or `undefined` if passed those values
strip_ansi | string | `strip_ansi(text)` | 3.18c | Strip all ANSI terminal control sequences from string, returns modified string or `null` or `undefined` if passed those values
strip_exascii | string | `strip_exascii(text)` | 3.10 | Strip all extended-ASCII characters from string, returns modified string or `null` or `undefined` if passed those values
skipsp | string | `skipsp(text)` | 3.15 | Skip (trim) white-space characters off beginning of string, returns modified string or `null` or `undefined` if passed those values
truncsp | string | `truncsp(text)` | 3.10 | Truncate (trim) white-space characters off end of string, returns modified string or `null` or `undefined` if passed those values
truncstr | string | `truncstr(text, charset)` | 3.10 | Truncate (trim) string at first char in charset, returns modified string or `null` or `undefined` if passed those values
lfexpand | string | `lfexpand(text)` | 3.10 | Expand sole line-feeds (LF) to carriage-return/line-feed sequences (CRLF), returns modified string or `null` or `undefined` if passed those values
wildmatch | boolean | `wildmatch([bool case_sensitive=false,] filename [,pattern='*'] [,path=false])` | 3.14 | Return `true` if the filename matches the wildcard pattern (wildcard characters supported are '*' and '?'), if path is `true`, '*' will not match path delimiter characters (e.g. '/')
backslash | string | `backslash(path)` | 3.12 | Return directory path with trailing (platform-specific) path delimiter (i.e. "slash" or "backslash")
fullpath | string | `fullpath(path)` | 3.15 | Create and return an absolute or full path name for the specified relative path name.
file_getname | string | `file_getname(path/filename)` | 3.11 | Return filename portion of passed path string
file_getext | string | `file_getext(path/filename)` | 3.11 | Return file extension portion of passed path/filename string (including '.') or `undefined` if no extension is found
file_getcase | string | `file_getcase(path/filename)` | 3.11 | Return correct case of filename (long version of filename on Windows) or `undefined` if the file doesn't exist
file_cfgname | string | `file_cfgname(path, filename)` | 3.12 | Return completed configuration filename from supplied path and filename, optionally including the local hostname (e.g. `path/file.host.domain.ext` or `path/file.host.ext`) if such a variation of the filename exists
file_getdosname | string | `file_getdosname(path/filename)` | 3.15 | Return DOS-compatible (Micros~1 shortened) version of specified path/filename(on Windows only) return unmodified path/filename on other platforms
file_exists | boolean | `file_exists(path/filename)` | 3.10 | Verify a file's existence
file_remove | boolean | `file_remove(path/filename)` | 3.10 | Delete a file
file_removecase | boolean | `file_removecase(path/filename)` | 3.14 | Delete files case insensitively
file_rename | boolean | `file_rename(path/oldname, path/newname)` | 3.11 | Rename a file, possibly moving it to another directory in the process
file_copy | boolean | `file_copy(path/source, path/destination)` | 3.11 | Copy a file from one directory or filename to another
file_backup | boolean | `file_backup(path/filename [,level=5] [,rename=false])` | 3.11 | Back up the specified filename as `filename.number.extension` where number is the backup number 0 through level-1 (default backup level is 5), if rename is `true`, the original file is renamed instead of copied (default is `false`)
file_isdir | boolean | `file_isdir(path/filename)` | 3.10 | Check if specified filename is a directory
file_attrib | number | `file_attrib(path/filename)` | 3.10 | Get a file's attributes (same as file_mode() on *nix). On Windows, the return value corresponds with `_finddata_t.attrib` (includes DOS/Windows file system-specific attributes, like hidden, and archive). Returns `-1` if the path/filename does not exist.
file_mode | number | `file_mode(path/filename)` | 3.17c | Get a file's type and mode flags (e.g. read/write/execute permissions). The return value corresponds with `struct stat.st_mode`. Returns `-1` if the path/filename does not exist.
file_chmod | boolean | `file_chmod(path/filename, number mode)` | 3.17c | Set a file's permissions flags. The supported mode bit values are system-dependent (e.g. Windows only supports setting or clearing the user-write/0x80 mode flag). Returns `true` if the requested change was successful.
file_date | number | `file_date(path/filename)` | 3.10 | Get a file's last modified date/time (in time_t format). Returns `-1` if the path/filename does not exist.
file_cdate | number | `file_cdate(path/filename)` | 3.17 | Get a file's creation date/time (in time_t format). Returns `-1` if the path/filename does not exist.
file_size | number | `file_size(path/filename)` | 3.10 | Get a file's length (in bytes). Returns `-1` if the path/filename does not exist.
file_utime | boolean | `file_utime(path/filename [,access_time=current] [,mod_time=current])` | 3.11 | Change a file's last accessed and modification date/time (in time_t format), or change to current time
file_touch | boolean | `file_touch(path/filename)` | 3.11 | Update a file's last modification date/time to current time, creating an empty file if it doesn't already exist
file_mutex | boolean | `file_mutex(path/filename [,string text=local_hostname] [,number max_age=0])` | 3.12 | Attempt to create an mutual-exclusion (e.g. lock) file, optionally with the contents of text. If a non-zero max_age is specified and the lock file exists, but is older than this value (in seconds), it is presumed stale and removed/over-written
file_compare | boolean | `file_compare(path/file1, path/file2)` | 3.14 | Compare 2 files, returning `true` if they are identical, `false` otherwise
directory | array | `directory(path/pattern [,flags=GLOB_MARK])` | 3.10 | Return an array of directory entries, pattern is the path and filename or wildcards to search for (e.g. '/subdir/*.txt'), flags is a set of optional `glob` bit-flags (default is `GLOB_MARK`)
dir_freespace | number | `dir_freespace(directory [,unit_size=1])` | 3.11 | Return the amount of available disk space in the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of `1000` to return the available space in kilobytes or `1024 for kibibytes.`
disk_size | number | `disk_size(directory [,unit_size=1])` | 3.14 | Return the total disk size of the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of `1000` to return the total disk size in kilobytes or `1024 for kibibytes.`
socket_select | array | `socket_select([array of socket objects or descriptors] [,number timeout=0] [,bool write=false])` | 3.11 | Check an array of socket objects or descriptors for read or write ability (default is read), default timeout value is 0.0 seconds (immediate timeout), returns an array of 0-based index values into the socket array, representing the sockets that were ready for reading or writing, or `null` on error. If multiple arrays of sockets are passed, they are presumed to be in the order of read, write, and except. In this case, the write parameter is ignored and an object is returned instead with up to three properties "read", "write", and "except", corresponding to the passed arrays. Empty passed arrays will not have a corresponding property in the returned object.
socket_strerror | string | `socket_strerror(error)` | 3.18c | Get the description(string representation) of a numeric socket error value (e.g. `socket_errno`)
strerror | string | `strerror(error)` | 3.18c | Get the description(string representation) of a numeric system error value (e.g. `errno`)
mkdir | boolean | `mkdir(path/directory)` | 3.10 | Make a directory on a local file system
mkpath | boolean | `mkpath(path/directory)` | 3.15 | Make a path to a directory (creating all necessary sub-directories). Returns `true` if the directory already exists.
rmdir | boolean | `rmdir(path/directory)` | 3.10 | Remove a directory
rmfiles | boolean | `rmfiles(path/directory [,file-spec='*'] [,files-to-keep=0])` | 3.20 | Remove all files and sub-directories in the specified directory, recursively - use with caution!
strftime | string | `strftime(format [,time=current])` | 3.10 | Return a formatted time string (ala the standard C `strftime` function)
format | string | `format(format [,args])` | 3.10 | Return a C-style formatted string (ala the standard C `sprintf` function)
html_encode | string | `html_encode(text [,bool ex_ascii=true] [,bool white_space=true] [,bool ansi=true] [,bool ctrl_a=true] [, state (object)])` | 3.11 | Return an HTML-encoded text string (using standard HTML character entities), escaping IBM extended-ASCII (CP437), white-space characters, ANSI codes, and CTRL-A codes by default.Optionally storing the current ANSI state in state object
html_decode | string | `html_decode(html)` | 3.11 | Return a decoded HTML-encoded text string, translating HTML character entities into CP437 character equivalents
word_wrap | string | `word_wrap(text [,line_length=79 [,orig_line_length=79 [,bool handle_quotes=true [,number pmode=0]]]])` | 3.11 | Return a word-wrapped version of the text string argument optionally handing quotes magically, line_length defaults to 79, orig_line_length defaults to `79`, handle_quotes defaults to `true`, pmode defaults to `0`, `P_UTF8` and `P_RENEGADE` pmode bit-flags are supported and may be optionally specified as a set of bool values. Note: if the original text does not contain any carriage-return (CR) characters, lines are wrapped with sole line-feed (LF) characters.
quote_msg | string | `quote_msg(text [,line_length=79] [,prefix=" > "])` | 3.11 | Return a quoted version of the message text string argument, line_length defaults to `79`, prefix defaults to `" > "`
rot13_translate | string | `rot13_translate(text)` | 3.11 | Return ROT13-translated version of text string (will encode or decode text)
base64_encode | string | `base64_encode(text)` | 3.11 | Return base64-encoded version of text string or `null` on error
base64_decode | string | `base64_decode(text)` | 3.11 | Return base64-decoded text string or `null` on error
crc16_calc | number | `crc16_calc(text)` | 3.11 | Calculate and return 16-bit CRC of text string
crc32_calc | number | `crc32_calc(text)` | 3.11 | Calculate and return 32-bit CRC of text string
chksum_calc | number | `chksum_calc(text)` | 3.11 | Calculate and return 32-bit checksum of text string
md5_calc | string | `md5_calc(text [,bool hex=false])` | 3.11 | Calculate and return 128-bit MD5 digest of text string, result encoded in base64 (default) or hexadecimal (32 hex digits)
sha1_calc | string | `sha1_calc(text [,bool hex=false])` | 3.19 | Calculate and return 160-bit SHA-1 digest of text string, result encoded in base64 (default) or hexadecimal (40 hex digits)
resolve_ip | string | `resolve_ip(string hostname [,bool array=false])` | 3.11 | Resolve IP address of specified hostname (AKA gethostbyname). If array is `true`, will return an array of all addresses rather than just the first one (upon success). Returns `null` if unable to resolve address.
resolve_host | string | `resolve_host(ip_address)` | 3.11 | Resolve hostname of specified IP address (AKA gethostbyaddr). Returns `null` if unable to resolve address.
netaddr_type | number | `netaddr_type(email_address)` | 3.12 | Return the proper message net_type for the specified email_address, (e.g. `NET_INTERNET` for Internet e-mail or `NET_NONE` for local e-mail)
list_named_queues | array | `list_named_queues()` | 3.12 | Return an array of named queues (created with the Queue constructor)
flags_str | undefined | `flags_str(string or number)` | 3.13 | Convert a string of security flags (letters) into their numeric value or vice-versa, returns number OR string
utf8_encode | string | `utf8_encode([string CP437] or [string UTF16] or [number codepoint])` | 3.17c | Return UTF-8 encoded version of the specified CP437 text string, UTF-16 encoded text string, or a single Unicode codepoint
utf8_decode | string | `utf8_decode(text)` | 3.17c | Return CP437 representation of UTF-8 encoded text string or `null` on error (invalid UTF-8)
utf8_get_width | number | `utf8_get_width(text)` | 3.17c | Return the fixed printed-width of the specified string of UTF-8 encoded characters
str_is_utf8 | boolean | `str_is_utf8(text)` | 3.17c | Return `true` if the specified string contains only valid UTF-8 encoded and US-ASCII characters
str_is_utf16 | boolean | `str_is_utf16(text)` | 3.17c | Return `true` if the specified string contains one or more UTF-16 encoded characters
str_is_ascii | boolean | `str_is_ascii(text)` | 3.17c | Return `true` if the specified string contains only US-ASCII (no CP437 or UTF-8) characters
str_has_ctrl | boolean | `str_has_ctrl(text)` | 3.17c | Return `true` if the specified string contains any control characters (ASCII 0x01 - 0x1F)

`global` properties
Name | Type | Ver | Description
--- | --- | --- | ---
user | User | N/A | Instance of the User class representing the current user 'online'
argc | number | N/A | Count of arguments passed to the script
argv | array | N/A | Array of argument strings (argv.length == argc)
errno | number | 3.10h | Last system error number
errno_str | string | 3.10h | Description of last system error
socket_errno | number | 3.13a | Last socket-related error number (same as errno on Unix platforms)
socket_errno_str | string | 3.18a | Description of last socket-related error (same as errno_str on Unix platforms)

## js object
JavaScript engine internal control object - introduced in v3.11

`js` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
eval | undefined | `js.eval(script)` | 3.11 | Evaluate a JavaScript string in its own (secure) context, returning the result
gc | void | `js.gc(forced=true)` | 3.11 | Perform a garbage collection operation (freeing memory for unused allocated objects), if forced is `true` (the default) a garbage collection is always performed, otherwise it is only performed if deemed appropriate by the JavaScript engine
on_exit | void | `js.on_exit(to_eval)` | 3.13 | Add a string to evaluate/execute (LIFO stack) upon script's termination (e.g. call of `exit()`)
report_error | void | `js.report_error(error [,fatal=false])` | 3.13 | Report an error using the standard JavaScript error reporting mechanism (including script filename and line number), if fatal is `true`, immediately terminates script
flatten_string | void | `js.flatten_string(string value)` | 3.16 | Flatten a string, optimizing allocated memory used for concatenated strings
exec | number | `js.exec(string filename [,string startup_dir], object scope [,...])` | 3.17c | Execute a script within the specified scope. The main difference between this method and `load()` is that scripts invoked in this way can call `exit()` without terminating the caller. If it does, any `on_exit()` handlers will be evaluated in the script's scope when the script exits. NOTE: to get a child of the current scope, you need to create an object in the current scope. An anonymous object can be created using '`new function(){}`'. TIP: Use `js.exec.apply()` if you need to pass a variable number of arguments to the executed script.
setTimeout | number | `js.setTimeout(callback, time [,thisObj])` | 3.19 | Install a timeout timer. `callback()` will be called `time` (milliseconds) after this function is called. Returns an id which can be passed to `clearTimeout()`
setInterval | number | `js.setInterval(callback, period [,thisObj])` | 3.19 | Install an interval timer. `callback()` will be called every `period` (milliseconds) after `setInterval()` is called. Returns an id which can be passed to `clearInterval()`
clearTimeout | void | `js.clearTimeout(id)` | 3.19 | Remove a timeout timer
clearInterval | void | `js.clearInterval(id)` | 3.19 | Remove an interval timer
addEventListener | number | `js.addEventListener(eventName, callback)` | 3.19 | Add a listener that is ran after `js.dispatchEvent(eventName)` is called. Returns an id to be passed to `js.removeEventListener()`
removeEventListener | void | `js.removeEventListener(id)` | 3.19 | Remove listeners added with `js.addEventListener()`. `id` can be a string or an id returned by `addEventListener()`. This does not remove already triggered callbacks from the run queue.
dispatchEvent | void | `js.dispatchEvent(eventName [,object thisObj])` | 3.19 | Add all listeners of eventName to the end of the run queue. If `thisObj` is passed, specifies `this` in the callback (the `js` object is used otherwise).
setImmediate | void | `js.setImmediate(callback [,thisObj])` | 3.19 | Add `callback` to the end of the run queue, where it will be called after all pending events are processed

`js` properties
Name | Type | Ver | Description
--- | --- | --- | ---
version | string | 3.11 | JavaScript engine version information (AKA system.js_version) - READ ONLY
auto_terminate | boolean | 3.11 | Set to false to disable the automatic termination of the script upon external request or user disconnection
terminated | boolean | 3.11 | Termination has been requested (stop execution as soon as possible)
counter | number | 3.16 | Number of operation callbacks performed in this runtime
time_limit | number | 3.16 | Maximum number of operation callbacks, used for infinite-loop detection (0=disabled)
yield_interval | number | 3.11 | Interval of periodic time-slice yields (lower number=higher frequency, 0=disabled)
gc_interval | number | 3.11 | Interval of periodic garbage collection attempts (lower number=higher frequency, 0=disabled)
gc_attempts | number | 3.11 | Number of garbage collections attempted in this runtime - READ ONLY
global | object | 3.14 | Global (top level) object - READ ONLY
options | number | 3.18c | Option flags - READ ONLY
do_callbacks | boolean | 3.19 | Do callbacks after script finishes running
load_path_list | object | N/A | `load()` search path array. For relative load paths (e.g. not beginning with '/' or '\'), the path is assumed to be a sub-directory of the (configurable) mods or exec directories and is searched accordingly. So, by default, `load("somefile.js")` will search in this order:`mods/load/somefile.js exec/load/somefile.js mods/somefile.js exec/somefile.js`
exec_path | string | N/A | Full path and filename of JS file executed
exec_file | string | N/A | JS filename executed (with no path)
exec_dir | string | N/A | Directory of executed JS file
startup_dir | string | N/A | Either the configured startup directory in SCFG (for externals) or the CWD when jsexec was started
scope | object | N/A | Global scope for this script

## system object
Global system-related properties and methods - introduced in v3.10

`system` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
username | string | `system.username(user_number)` | 3.11 | Return name of user in specified user record number, or empty string if not found
alias | string | `system.alias(alias)` | 3.10 | Return name of user that matches alias (if found in `ctrl/alias.cfg`)
find_login_id | number | `system.find_login_id(user-id)` | 3.20 | Find a user's login ID (alias, real name, or number), returns matching user record number or 0 if not found
matchuser | number | `system.matchuser(username [,sysop_alias=true])` | 3.10 | Exact user name matching, returns number of user whose name/alias matches username or 0 if not found, matches well-known sysop aliases by default
matchuserdata | number | `system.matchuserdata(field, data [,bool match_del=false] [,number usernumber, bool match_next=false])` | 3.10 | Search user database for data in a specific field (see `U_*` in `sbbsdefs.js`). If match_del is `true`, deleted user records are searched, returns first matching user record number, optional usernumber specifies user record to skip, or record at which to begin searching if optional match_next is `true`.
trashcan | boolean | `system.trashcan(basename, find_string)` | 3.10 | Search `text/basename.can` for pseudo-regexp
findstr | boolean | `system.findstr(path/filename or array of strings, find_string)` | 3.10 | Search any trashcan/filter file or array of pattern strings (in `*.can` format) for find_string
zonestr | string | `system.zonestr([timezone=local])` | 3.10 | Convert time zone integer to string, defaults to system timezone if timezone not specified
timestr | string | `system.timestr([time=current])` | 3.10 | Convert time_t integer into a time string, defaults to current time if time not specified
datestr | string | `system.datestr([time=current])` | 3.10 | Convert time_t integer into a short (8 character) date string, in either numeric or verbal format (depending on system preference), defaults to current date if time not specified. If time is a string in numeric date format, returns the parsed time_t value as a number.
secondstr | string | `system.secondstr(seconds [,bool verbose=true])` | 3.10 | Convert a duration in seconds into a string in `hh:mm:ss` format
minutestr | string | `system.minutestr(minutes [,bool estimate=false] [,bool words=false])` | 3.21 | Convert a duration in minutes into a string in `'DDd HHh MMm'`, `'X.Yh'` or `'X.h hours'` format
spamlog | boolean | `system.spamlog([protocol, action, reason, host, ip, to, from])` | 3.10 | Log a suspected SPAM attempt
hacklog | boolean | `system.hacklog([protocol, user, text, host, ip, port])` | 3.10 | Log a suspected hack attempt
filter_ip | boolean | `system.filter_ip([protocol, reason, host, ip, username, filename] [number duration-in-seconds])` | 3.11 | Add an IP address (with comment) to an IP filter file. If filename is not specified, the ip.can file is used
get_node | object | `system.get_node(node_number)` | 3.17c | Read a node data record all at once (and leaving the record unlocked) returning an object matching the elements of `system.node_list`
get_node_message | string | `system.get_node_message(node_number)` | 3.11 | Read any messages waiting for the specified node and return in a single string or null if none are waiting
put_node_message | boolean | `system.put_node_message(node_number, message_text)` | 3.10 | Send a node a short text message, delivered immediately
get_telegram | string | `system.get_telegram(user_number)` | 3.11 | Return any short text messages waiting for the specified user or null if none are waiting
put_telegram | boolean | `system.put_telegram(user_number, message_text)` | 3.10 | Send a user a short text message, delivered immediately or during next logon
notify | boolean | `system.notify(user_number, subject [,message_text] [,reply_to_address])` | 3.18b | Notify a user or operator via both email and a short text message about an important event
new_user | object | `system.new_user(name/alias [,client object])` | 3.10 | Create a new user record, returns a new User object representing the new user account, on success. returns a numeric error code on failure
del_user | boolean | `system.del_user(user_number)` | 3.16 | Delete the specified user account
undel_user | boolean | `system.undel_user(user_number)` | 3.21 | Un-delete the specified user account
exec | number | `system.exec(command-line)` | 3.11 | Execute a native system/shell command-line, returns 0 on success
popen | array | `system.popen(command-line)` | 3.11 | Execute a native system/shell command-line, returns array of captured output lines on success (only functional on UNIX systems)
check_syspass | boolean | `system.check_syspass(password)` | 3.11 | Compare the supplied password against the system password and returns `true` if it matches
check_name | boolean | `system.check_name(name/alias [,bool unique=true])` | 3.15 | Check that the provided name/alias string is suitable for a new user account, returns `true` if it is valid and (optionally) if it is unique
check_realname | boolean | `system.check_realname(name)` | 3.21 | Check that the provided real user name string is suitable for a new user account, returns `true` if it is valid
check_password | boolean | `system.check_password(password)` | 3.21 | Check that the provided string is suitable for a new user password, returns `true` if it meets the system criteria for a user password. Does not check the `password.can` file.
check_netmail_addr | boolean | `system.check_netmail_addr(address)` | 3.21 | Check if the specified address is in a supported NetMail address format, returns `true` if it is supported
check_birthdate | boolean | `system.check_birthdate(string)` | 3.21 | Check if the specified string is a valid birth date, returns `true` if it is valid
check_filename | boolean | `system.check_filename(filename)` | 3.19c | Verify that the specified filename string is legal and allowed for upload by users (based on system configuration and filter files), returns `true` if the filename is allowed
allowed_filename | boolean | `system.allowed_filename(filename)` | 3.19c | Verify that the specified filename string is allowed for upload by users (based on system configuration), returns `true` if the filename is allowed
safest_filename | boolean | `system.safest_filename(filename)` | 3.19c | Verify that the specified filename string contains only the safest subset of characters
illegal_filename | boolean | `system.illegal_filename(filename)` | 3.19c | Check if the specified filename string contains illegal characters or sequences, returns `true` if it is an illegal filename
check_pid | boolean | `system.check_pid(process-ID)` | 3.15 | Check that the provided process ID is a valid executing process on the system, returns `true` if it is valid
terminate_pid | boolean | `system.terminate_pid(process-ID)` | 3.15 | Terminate executing process on the system with the specified process ID, returns `true` on success
text | string | `system.text(number index or string id)` | 3.18c | Return specified text string (see `bbs.text()` for details) or `null` if invalid index or id specified. The string id support was added in v3.20.

`system` properties
Name | Type | Ver | Description
--- | --- | --- | ---
name | string | 3.10 | BBS name
operator | string | 3.10 | Operator name
operator_available | boolean | 3.18b | Operator is available for chat
guru | string | 3.20 | Default Guru (AI) name
qwk_id | string | 3.10 | System QWK-ID (for QWK packets)
settings | number | 3.10 | Settings bit-flags (see `SYS_*` in `sbbsdefs.js` for bit definitions)
login_settings | number | 3.20 | Login control settings bit-flags (see `LOGIN_*` in `sbbsdefs.js` for bit definitions)
inet_addr | string | 3.11 | Internet address (host or domain name)
location | string | 3.10 | Location (city, state)
timezone | number | 3.10 | Local timezone in SMB format (use system.zonestr() to get string representation)
tz_offset | number | 3.20 | Local timezone offset, in minutes, from UTC (negative values represent zones west of UTC, positive values represent zones east of UTC)
date_format | number | 3.20c | Date representation (0=Month first, 1=Day first, 2=Year first)
date_separator | string | 3.20c | Short (8 character) date field-separator
date_verbal | boolean | 3.20c | Short date month-name displayed verbally instead of numerically
birthdate_format | string | 3.20c | User birth date input and display format (MM=Month number, DD=Day of month, YYYY=Year)
birthdate_template | string | 3.20c | User birth date input template
phonenumber_template | string | 3.21 | User phone number input template
pwdays | number | 3.10 | Days between forced user password changes (`0`=never)
min_password_length | number | 3.17c | Minimum number of characters in user passwords
max_password_length | number | 3.17c | Maximum number of characters in user passwords
deldays | number | 3.10 | Days to preserve deleted user records, record will not be reused/overwritten during this period
autodel | number | 3.17c | Days of user inactivity before auto-deletion (`0`=disabled), N/A to P-exempt users
last_user | number | 3.11 | Last user record number in user database (includes deleted and inactive user records)
last_useron | string | 3.10 | Name of last user to logoff
freediskspace | number | 3.10 | Amount of free disk space (in bytes)
freediskspacek | number | 3.10 | Amount of free disk space (in kibibytes)
nodes | number | 3.10 | Total number of Terminal Server nodes
last_node | number | 3.10 | Last displayable node number
mqtt_enabled | boolean | 3.20 | MQTT support (connection to MQTT broker) is enabled
newuser_password | string | 3.10 | New user password (NUP, optional)
newuser_magic_word | string | 3.10 | New user magic word (optional)
newuser_level | number | 3.10 | New user security level
newuser_flags1 | number | 3.10 | New user flag set #1
newuser_flags2 | number | 3.10 | New user flag set #2
newuser_flags3 | number | 3.10 | New user flag set #3
newuser_flags4 | number | 3.10 | New user flag set #4
newuser_restrictions | number | 3.10 | New user restriction flags
newuser_exemptions | number | 3.10 | New user exemption flags
newuser_credits | number | 3.10 | New user credits
newuser_minutes | number | 3.10 | New user extra minutes
newuser_command_shell | string | 3.10 | New user default command shell
newuser_editor | string | 3.10 | New user default external editor
newuser_settings | number | 3.10 | New user default settings
newuser_download_protocol | string | 3.10 | New user default file transfer protocol (command key)
newuser_expiration_days | number | 3.10 | New user expiration days
newuser_questions | number | 3.10 | New user questions/prompts (see `UQ_*` in `sbbsdefs.js` for bit definitions)
expired_level | number | 3.10 | Expired user security level
expired_flags1 | number | 3.10 | Expired user flag set #1
expired_flags2 | number | 3.10 | Expired user flag set #2
expired_flags3 | number | 3.10 | Expired user flag set #3
expired_flags4 | number | 3.10 | Expired user flag set #4
expired_restrictions | number | 3.10 | Expired user restriction flags
expired_exemptions | number | 3.10 | Expired user exemption flags
node_dir | string | 3.10 | Current node directory
ctrl_dir | string | 3.10 | Control file directory
data_dir | string | 3.10 | Data file directory
text_dir | string | 3.10 | Text file directory
temp_dir | string | 3.10 | Temporary file directory
exec_dir | string | 3.10 | Executable file directory
mods_dir | string | 3.10 | Modified modules directory (optional)
logs_dir | string | 3.10 | Log file directory
devnull | string | 3.11 | Platform-specific "null" device filename
temp_path | string | 3.12 | Platform-specific temporary file directory
cmd_shell | string | 3.14 | Platform-specific command processor/shell
clock_ticks | number | 3.11 | Amount of elapsed time in clock 'ticks'
clock_ticks_per_second | number | 3.11 | Number of clock ticks per second
timer | number | 3.14 | High-resolution timer, in seconds (fractional seconds supported)
stats_interval | number | 3.21 | System statistics interval (cache duration) in seconds
local_host_name | string | 3.11 | Private host name that uniquely identifies this system on the local network
name_servers | object | 3.18c | Array of nameservers in use by the system
host_name | string | N/A | Public host name that uniquely identifies this system on the Internet (usually the same as system.inet_addr)
socket_lib | string | N/A | Socket library version information
uptime | number | N/A | Time/date system was brought online (in time_t format)
full_version | string | N/A | Synchronet full version information (e.g. '3.10k Beta Debug')
git_branch | string | N/A | Synchronet Git repository branch name
git_hash | string | N/A | Synchronet Git repository commit hash
git_date | string | N/A | Synchronet Git repository commit date/time
compiled_when | string | N/A | Date and time compiled
version | string | N/A | Synchronet version number (e.g. '3.10')
revision | string | N/A | Synchronet revision letter (e.g. 'k')
beta_version | string | N/A | Synchronet alpha/beta designation (e.g. ' beta')
version_notice | string | N/A | Synchronet version notice (includes version and platform)
version_num | number | N/A | Synchronet version number in decimal (e.g. 31301 for v3.13b)
version_hex | number | N/A | Synchronet version number in hexadecimal (e.g. 0x31301 for v3.13b)
git_time | number | N/A | Synchronet Git repository commit date/time (seconds since Unix epoch)
platform | string | N/A | Platform description (e.g. 'Win32', 'Linux', 'FreeBSD')
architecture | string | N/A | Architecture description (e.g. 'i386', 'i686', 'x86_64')
msgbase_lib | string | N/A | Message base library version information
compiled_with | string | N/A | Compiler used to build Synchronet
copyright | string | N/A | Synchronet copyright display
js_version | string | N/A | JavaScript engine version information
os_version | string | N/A | Operating system version information
fido_addr_list | object | N/A | Array of FidoNet Technology Network (FTN) addresses associated with this system

## system.stats object
System statistics - introduced in v3.10

`system.stats` properties
Name | Type | Ver | Description
--- | --- | --- | ---
total_logons | number | 3.10 | Total logons
logons_today | number | 3.10 | Logons today
total_timeon | number | 3.10 | Total time used
timeon_today | number | 3.10 | Time used today
total_files | number | 3.10 | Total files in file bases
files_uploaded_today | number | 3.10 | Files uploaded today
bytes_uploaded_today | number | 3.10 | Bytes uploaded today
files_downloaded_today | number | 3.10 | Files downloaded today
bytes_downloaded_today | number | 3.10 | Bytes downloaded today
total_messages | number | 3.10 | Total messages in message bases
messages_posted_today | number | 3.10 | Messages posted today
total_email | number | 3.10 | Total messages in mail base
email_sent_today | number | 3.10 | Email sent today
total_feedback | number | 3.10 | Total feedback messages waiting
feedback_sent_today | number | 3.10 | Feedback sent today
total_users | number | 3.10 | Total user records (does not include deleted or inactive user records)
new_users_today | number | 3.10 | New users today

## system.node_list array
Terminal Server node listing - introduced in v3.10

`system.node_list` properties
Name | Type | Ver | Description
--- | --- | --- | ---
status | number | 3.10 | Status (see `nodedefs.js` for valid values)
vstatus | string | 3.20 | Verbal status - READ ONLY
errors | number | 3.10 | Error counter
action | number | 3.10 | Current user action (see `nodedefs.js`)
activity | string | 3.20 | Current user activity - READ ONLYy
useron | number | 3.10 | Current user number
connection | number | 3.10 | Connection speed (`0xffff` = Telnet or RLogin)
misc | number | 3.10 | Miscellaneous bit-flags (see `nodedefs.js`)
aux | number | 3.10 | Auxiliary value
extaux | number | 3.10 | Extended auxiliary value
dir | string | 3.15 | Node directory - READ ONLY

## server object
Server-specific properties - introduced in v3.10

`server` properties
Name | Type | Ver | Description
--- | --- | --- | ---
version | string | 3.10 | Server name and version number
version_detail | string | 3.10 | Detailed version/build information
interface_ip_address | string | 3.11 | First bound IPv4 address (`0.0.0.0` = ANY) (obsolete since 3.17, see interface_ip_addr_list)
options | number | 3.11 | Bit-field of server-specific startup options
clients | number | 3.11 | Number of active clients (if available)
interface_ip_addr_list | object | N/A | Array of IP addresses of bound network interface (`0.0.0.0` = ANY)

## client object
Represents a TCP/IP client session - introduced in v3.10

`client` properties
Name | Type | Ver | Description
--- | --- | --- | ---
ip_address | string | 3.10 | Client's IPv4 or IPv6 address
host_name | string | 3.10 | Client's host name (up to 64 characters)
port | number | 3.10 | Client's TCP or UDP port number
connect_time | number | 3.10 | Date/time of initial connection (in time_t format)
protocol | string | 3.10 | Protocol/service name (e.g. 'Telnet', 'FTP', etc.)
user_name | string | 3.10 | User's name/alias
user_number | number | 3.17c | User's number (non-zero if logged in)
socket | object | N/A | Instance of Socket class representing client's TCP/IP connection

## bbs object
Controls the Terminal Server (traditional BBS) experience - introduced in v3.10

`bbs` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
atcode | string | `bbs.atcode(code_string)` | 3.10 | Return @-code value, specified code string does not include @ character delimiters.
expand_atcodes | string | `bbs.expand_atcodes(string [,object msg_header])` | 3.20 | Return string with @-code expanded values (some formatting and @-codes are not supported), using optional `msg_header` for `MSG_*` codes.
text | string | `bbs.text(number index or string id [,bool default_text=false])` | 3.10 | Return current text string (specified via 1-based string index number or identifier string) from `text.dat`, `text.ini` or replacement text or null upon error New in v3.20: Passing string identifier (`id`) for fast/cached look-up of text string by ID. Use `bbs.text.ID` to obtain a text string index number from its corresponding ID (name). The `default_text` argument can be used to get a default language (i.e. `text.dat` file) string value.
replace_text | boolean | `bbs.replace_text(number index or string id, text)` | 3.10 | Replace specified `text.dat` or `text.ini` string in memory.
revert_text | boolean | `bbs.revert_text([number index or string id])` | 3.10 | Revert specified text string to original `text.dat` or `text.ini` string; if index and id are unspecified, reverts all text strings.
load_text | boolean | `bbs.load_text(filename)` | 3.10 | Load alternate text strings (in `text.dat` or `text.ini` format) from a file in the ctrl directory.A `.dat` extension is automatically added to the filename if no extension was specified. Note: `text.ini` support added to this method in v3.20c.
load_user_text | boolean | `bbs.load_user_text()` | 3.20 | Load text strings from the user's selected language (`ctrl/text.*.ini`) file.
newuser | void | `bbs.newuser()` | 3.10 | Initiate interactive new user registration procedure.
login | boolean | `bbs.login(user_name [,password_prompt] [,user_password] [,system_password])` | 3.10 | Login with user_name, displaying password_prompt for user's password (if required), optionally supplying the user's password and the system password as arguments so as to not be prompted.
logon | boolean | `bbs.logon()` | 3.10 | Initiate interactive user-logon procedure.
logoff | boolean | `bbs.logoff([prompt=true])` | 3.15 | Initiate interactive user-logoff procedure, pass `false` for prompt argument to avoid yes/no prompt, returns `false` if denied logoff, hangs-up (disconnects) upon completion of logoff.
logout | void | `bbs.logout()` | 3.10 | Initiate non-interactive user-logout procedure, invoked implicitly upon user-disconnect. Only invoke this method to force a logout without a disconnect.
hangup | void | `bbs.hangup()` | 3.10 | Hang-up (disconnect) the connected user/client immediately.
nodesync | void | `bbs.nodesync([clear-line=false])` | 3.10 | Synchronize with node database, checks for messages, interruption, etc. (AKA node_sync), clears the current console line if there's a message to print when clear-line is `true`.
auto_msg | void | `bbs.auto_msg()` | 3.10 | Read/create system's auto-message.
time_bank | void | `bbs.time_bank()` | 3.10 | Enter the time banking system.
email_sec | void | `bbs.email_sec()` | 3.21 | Enter the E-Mail section.
qwk_sec | void | `bbs.qwk_sec()` | 3.10 | Enter the QWK message packet upload/download/config section.
text_sec | void | `bbs.text_sec()` | 3.10 | Enter the text files section.
xtrn_sec | void | `bbs.xtrn_sec([section])` | 3.10 | Enter the external programs section (or go directly to the specified section).
chat_sec | void | `bbs.chat_sec()` | 3.20 | Enter the chat section/menu.
xfer_policy | void | `bbs.xfer_policy()` | 3.10 | Display the file transfer policy.
xfer_prot_menu | string | `bbs.xfer_prot_menu([bool upload=false] [,bool batch=false])` | 3.20 | Display file transfer protocol menu, returns protocol command keys.
batch_menu | void | `bbs.batch_menu()` | 3.10 | Enter the batch file transfer menu.
batch_download | boolean | `bbs.batch_download()` | 3.10 | Start a batch download.
batch_add_list | void | `bbs.batch_add_list(list_filename)` | 3.10 | Add file list to batch download queue.
batch_sort | boolean | `bbs.batch_sort([upload_queue=false])` | 3.20 | Sort the batch download or batch upload queue.
batch_clear | boolean | `bbs.batch_clear([upload_queue=false])` | 3.20 | Clear the batch download or batch upload queue.
batch_remove | number | `bbs.batch_remove(bool upload_queue, string filename_or_pattern or number index)` | 3.20 | Remove one or more files from the batch download or batch upload queue.
view_file | boolean | `bbs.view_file(filename)` | 3.19 | List contents of specified filename (complete path).
send_file | boolean | `bbs.send_file(filename [,protocol] [,description] [,autohang=true])` | 3.14 | Send specified filename (complete path) to user via user-prompted (or optionally specified) protocol. The optional description string is used for logging purposes. When autohang is `true`, disconnect after transfer based on user's default setting.
receive_file | boolean | `bbs.receive_file(filename [,protocol] [,autohang=true])` | 3.14 | Received specified filename (complete path) from user via user-prompted (or optionally specified) protocol. When autohang is `true`, disconnect after transfer based on user's default setting.
temp_xfer | void | `bbs.temp_xfer()` | 3.10 | Enter the temporary file tranfer menu.
user_sync | void | `bbs.user_sync()` | 3.10 | Read the current user data from the database.
user_config | void | `bbs.user_config()` | 3.10 | Enter the user settings configuration menu.
sys_info | void | `bbs.sys_info()` | 3.10 | Display system information.
sub_info | void | `bbs.sub_info([sub-board=current])` | 3.10 | Display message sub-board information (current sub-board, if unspecified).
dir_info | void | `bbs.dir_info([directory=current])` | 3.10 | Display file directory information (current directory, if unspecified).
user_info | void | `bbs.user_info()` | 3.10 | Display current user information.
ver | void | `bbs.ver([number p_mode=P_CENTER | P_80COLS] [,bool verbose=true])` | 3.10 | Display BBS software version information.
sys_stats | void | `bbs.sys_stats()` | 3.10 | Display system statistics.
node_stats | void | `bbs.node_stats([number node=current])` | 3.10 | Display current (or specified) node statistics.
list_users | void | `bbs.list_users([mode=UL_ALL])` | 3.10 | Display user list(see `UL_*` in `sbbsdefs.js` for valid mode values).
edit_user | void | `bbs.edit_user([number user=current])` | 3.10 | Enter the user editor.
change_user | boolean | `bbs.change_user([username or number])` | 3.10 | Change to a different user. Will prompt for user name or number when none is passed.
matchuserdata | number | `bbs.matchuserdata(field, data [,bool match_del=false] [,number usernumber, bool match_next=false])` | 3.21 | Search user database for data in a specific field, with progress indication. See `system.matchuserdata()` for more details on usage.
list_logons | void | `bbs.list_logons([arguments])` | 3.10 | Display the logon list (optionally passing arguments to the logon list module).
read_mail | number | `bbs.read_mail([number which=MAIL_YOUR] [,number user=current] [,number loadmail_mode=0] [,bool listmsgs=true)` | 3.10 | Read private e-mail(see `MAIL_*` in `sbbsdefs.js` for valid which values), returns user-modified loadmail_mode value.
email | boolean | `bbs.email(number to_user [,number mode=WM_EMAIL] [,string top=none] [,string subject=none] [,object reply_header])` | 3.10 | Send private e-mail to a local user.
netmail | boolean | `bbs.netmail([string address or array of addresses] [,number mode=WM_NONE] [,string subject=none] [,object reply_header])` | 3.10 | Send private netmail.
bulk_mail | void | `bbs.bulk_mail([ars])` | 3.10 | Send bulk private e-mail, if ars not specified, prompt for destination users.
upload_file | boolean | `bbs.upload_file([directory=current] [,string filename=undefined])` | 3.10 | Upload file to file directory specified by number or internal code. Will prompt for filename when none is passed.
batch_upload | boolean | `bbs.batch_upload()` | 3.20 | Start a batch upload of one or more files. The user's batch upload queue must have one or more files or an 'Uploads' directory must be configured (`file_area.upload_dir` is not `undefined`). Returns `true` if one or more blind-uploads were received and all files in the batch upload queue (if any) were received successfully.
bulk_upload | boolean | `bbs.bulk_upload([directory=current])` | 3.10 | Add files (already in local storage path) to file directory specified by number or internal code.
export_filelist | number | `bbs.export_filelist(filename [,number mode=FL_NONE])` | 3.19 | Export list of files to a text file, optionally specifying a file list mode (e.g. `FL_ULTIME`), returning the number of files listed.
list_files | number | `bbs.list_files([directory=current] [,string filespec="*.*" or search_string] [,number mode=FL_NONE])` | 3.10 | List files in the specified file directory, optionally specifying a file specification (wildcards) or a description search string, and mode (bit-flags).
list_file_info | number | `bbs.list_file_info([directory=current] [,string filespec="*.*"] [,number mode=FI_INFO])` | 3.10 | List extended file information for files in the specified file directory.
post_msg | boolean | `bbs.post_msg([sub-board=current] [,number mode=WM_NONE] [,object reply_header])` | 3.13 | Post a message in the specified message sub-board (number or internal code) with optional mode (bit-flags) If reply_header is specified (a header object returned from MsgBase.get_msg_header()), that header will be used for the in-reply-to header fields.
forward_msg | boolean | `bbs.forward_msg(object header, string to [,string subject] [,string comment])` | 3.18c | Forward a message.
edit_msg | boolean | `bbs.edit_msg(object header)` | 3.18c | Edit a message.
show_msg | boolean | `bbs.show_msg(object header [,number mode=P_NONE] )` | 3.17c | Show a message's header and body (text) with optional print mode (bit-flags) header must be a header object returned from MsgBase.get_msg_header()).
show_msg_header | void | `bbs.show_msg_header(object header [,string subject] [,string from] [,string to])` | 3.17c | Show a message's header (only) header must be a header object returned from MsgBase.get_msg_header()).
download_msg_attachments | void | `bbs.download_msg_attachments(object header)` | 3.17c | Prompt the user to download each of the message's file attachments (if there are any) header must be a header object returned from MsgBase.get_msg_header()).
change_msg_attr | number | `bbs.change_msg_attr(object header)` | 3.17c | Prompt the user to modify the specified message header attributes.
cfg_msg_scan | void | `bbs.cfg_msg_scan([number type=SCAN_CFG_NEW])` | 3.10 | Configure message scan (type is either `SCAN_CFG_NEW` or `SCAN_CFG_TOYOU`).
cfg_msg_ptrs | void | `bbs.cfg_msg_ptrs()` | 3.10 | Change message scan pointer values.
reinit_msg_ptrs | void | `bbs.reinit_msg_ptrs()` | 3.10 | Re-initialize new message scan pointers to values at logon.
save_msg_scan | void | `bbs.save_msg_scan()` | 3.20 | Save message scan configuration and pointers to userbase.
reload_msg_scan | void | `bbs.reload_msg_scan()` | 3.20 | Re-load message scan configuration and pointers from userbase.
scan_subs | void | `bbs.scan_subs([number mode=SCAN_NEW] [,bool all=false])` | 3.10 | Scan sub-boards for messages.
scan_dirs | void | `bbs.scan_dirs([number mode=FL_NONE] [,bool all=false])` | 3.10 | Scan directories for files.
scan_msgs | boolean | `bbs.scan_msgs([sub-board=current] [,number mode=SCAN_READ] [,string find])` | 3.10 | Scan messages in the specified message sub-board (number or internal code), optionally search for 'find' string (AKA scan_posts).
list_msgs | number | `bbs.list_msgs([sub-board=current] [,number mode=SCAN_INDEX] [,number message_number=0] [,string find])` | 3.14 | List messages in the specified message sub-board (number or internal code), optionally search for 'find' string, returns number of messages listed.
menu | boolean | `bbs.menu(base_filename [,number mode=P_NONE] [,object scope])` | 3.10 | Display a menu file from the text/menu directory. See `P_*` in `sbbsdefs.js` for mode flags. When scope is specified, `@JS:property@` codes will expand the referenced property names. To display a randomly-chosen menu file, including wild-card (* or ?) characters in the `base_filename`.
menu_exists | boolean | `bbs.menu_exists(base_filename)` | 3.17 | Return `true` if the referenced menu file exists (i.e. in the text/menu directory).
log_key | boolean | `bbs.log_key(key [,comma=false])` | 3.10 | Log key to `node.log` file (comma optional).
log_str | boolean | `bbs.log_str(text)` | 3.10 | Log string to `node.log` file.
logline | boolean | `bbs.logline([level=LOG_INFO], code, text)` | 3.21 | Log string with a 1-2 character search code/prefix to `node.log` file, optionally specifying a priority level.
finduser | number | `bbs.finduser(username_or_number)` | 3.10 | Find user name (partial name support), interactive.
trashcan | boolean | `bbs.trashcan(base_filename, search_string)` | 3.10 | Search file for pseudo-regexp (search string) in trashcan file (`text/base_filename.can`).
exec | number | `bbs.exec(cmdline [,number mode=EX_NONE] [,string startup_dir])` | 3.10 | Execute a program, optionally changing current directory to startup_dir (see `EX_*` in `sbbsdefs.js` for valid mode flags.)
exec_xtrn | boolean | `bbs.exec_xtrn(xtrn_number_or_code)` | 3.10 | Execute external program by number or internal code.
user_event | boolean | `bbs.user_event(event_type)` | 3.10 | Execute user event by event type (see `EVENT_*` in `sbbsdefs.js` for valid values).
telnet_gate | boolean | `bbs.telnet_gate(address[:port] [,number mode=TG_NONE] [,number timeout=10] [,array send_strings])` | 3.10 | External Telnet gateway (see `TG_*` in `sbbsdefs.js` for valid mode flags).
rlogin_gate | boolean | `bbs.rlogin_gate(address[:port] [,string client-user-name=user.alias, string server-user-name=user.name, string terminal=console.terminal] [,number mode=TG_NONE] [,number timeout=10] [,array send_strings])` | 3.16 | External RLogin gateway (see `TG_*` in `sbbsdefs.js` for valid mode flags).
check_filename | boolean | `bbs.check_filename(filename)` | 3.19c | Verify that the specified filename string is legal and allowed for upload (based on system configuration), returns `true` if the filename is allowed. Note: Will display `text/badfile.msg` for matching filenames, if it exists.
check_syspass | boolean | `bbs.check_syspass([sys_pw])` | 3.10 | Verify system password, prompting for the password if not passed as an argument.
check_password | boolean | `bbs.check_password(password, [forced_unique=false])` | 3.10 | Check if requested user password meets minimum password requirements (length, uniqueness, etc.) (AKA good_password). Also checks the `password.can` filter file. When forced_unique is `true`, the password must be substantially different from the user's current password.
page_sysop | boolean | `bbs.page_sysop()` | 3.10 | Page the sysop for chat, returns `false` if the sysop could not be paged.
page_guru | boolean | `bbs.page_guru()` | 3.10 | Page the guru for chat.
multinode_chat | void | `bbs.multinode_chat([number channel=1])` | 3.10 | Enter multi-node chat.
private_message | void | `bbs.private_message()` | 3.10 | Use the private inter-node message prompt.
private_chat | void | `bbs.private_chat([local=false])` | 3.10 | Enter private inter-node chat, or local sysop chat (if local=`true`).
get_node_message | void | `bbs.get_node_message([bool clear-line=false])` | 3.10 | Receive and display an inter-node message.
put_node_message | boolean | `bbs.put_node_message([number node_number] [,text])` | 3.17 | Send an inter-node message (specify a node_number value of `-1` for 'all active nodes').
get_telegram | void | `bbs.get_telegram([number user_number=current], [bool clear-line=false])` | 3.10 | Receive and display waiting telegrams for specified (or current) user.
put_telegram | boolean | `bbs.put_telegram([number user_number] [,text])` | 3.17 | Send a telegram (short multi-line stored message) to a useri.
list_nodes | void | `bbs.list_nodes()` | 3.10 | List all nodes.
whos_online | void | `bbs.whos_online()` | 3.10 | List active nodes only (who's online).
spy | void | `bbs.spy(number node)` | 3.10 | Spy on a node.
cmdstr | string | `bbs.cmdstr(command_string [,string fpath=""] [,string fspec=""])` | 3.10 | Return expanded command string using Synchronet command-line specifiers.
get_filespec | string | `bbs.get_filespec()` | 3.10 | Return a file specification input by the user (optionally with wildcards).
get_newscantime | number | `bbs.get_newscantime([number time=current])` | 3.10 | Confirm or change a new-scan time, returns the new new-scan time value (time_t format).
select_shell | boolean | `bbs.select_shell([User user=current])` | 3.10 | Prompt user to select a new command shell.
select_editor | boolean | `bbs.select_editor([User user=current])` | 3.10 | Prompt user to select a new external message editor.
get_time_left | number | `bbs.get_time_left()` | 3.14b | Check the user's available remaining time online and return the value, in seconds. This method will inform (and disconnect) the user when they are out of time.
compare_ars | boolean | `bbs.compare_ars(requirements)` | 3.15 | Verify and return `true` if the current user online meets the specified access requirements string. Always returns `true` when passed `null`, `undefined`, or an empty string.
select_node | number | `bbs.select_node(bool all_is_an_option=false)` | 3.17 | Choose an active node to interact with. Returns the selected node number, 0 (for none) or -1 for 'All'.
select_user | number | `bbs.select_user()` | 3.17 | Choose a user to interact with.

## bbs.mods object
Global parent for stock or 3rd party persistently-stored load libraries and their data - introduced in v3.12

`bbs` properties
Name | Type | Ver | Description
--- | --- | --- | ---
sys_status | number | 3.10 | System status bit-flags (see `SS_*` in `sbbsdefs.js` for bit definitions)
startup_options | number | 3.10 | Startup options bit-flags (see `BBS_OPT_*` in `sbbsdefs.js` for bit definitions)
answer_time | number | 3.10 | Answer time, in time_t format
logon_time | number | 3.10 | Logon time, in time_t format
start_time | number | 3.14 | Time from which user's time left is calculated, in time_t format
new_file_time | number | 3.10 | Current file new-scan time, in time_t format
last_new_file_time | number | 3.10 | Previous file new-scan time, in time_t format
online | number | 3.10 | Online (see `ON_*` in `sbbsdefs.js` for valid values)
time_left | number | 3.11 | Time left (in seconds)
event_time | number | 3.11 | Time of next exclusive event (in time_t format), or 0 if none
event_code | string | 3.11 | Internal code of next exclusive event
first_node | number | 3.20 | First node number (of this instance of Synchronet)
last_node | number | 3.20 | Last node number (of this instance of Synchronet)
node_num | number | 3.10 | Current node number
node_settings | number | 3.10 | Current node settings bit-flags (see `NM_*` in `sbbsdefs.js` for bit definitions)
node_status | number | 3.17 | Current node status value (see `nodedefs.js` for valid values)
node_errors | number | 3.17 | Current node error counter
node_action | number | 3.10 | Current node action (see `nodedefs.js` for valid values)
node_useron | number | 3.17 | Current node user number (useron value)
node_connection | number | 3.17 | Current node connection type (see `nodedefs.js` for valid values)
node_misc | number | 3.17 | Current node misc value (see `nodedefs.js` for valid values)
node_aux | number | 3.17 | Current node aux value
node_extaux | number | 3.17 | Current node extended aux (extaux) value
node_val_user | number | 3.10 | Validation feedback user for this node (or 0 for no validation feedback required)
logon_ulb | number | 3.10 | Bytes uploaded during this session
logon_dlb | number | 3.10 | Bytes downloaded during this session
logon_uls | number | 3.10 | Files uploaded during this session
logon_dls | number | 3.10 | Files downloaded during this session
logon_posts | number | 3.10 | Messages posted during this session
logon_emails | number | 3.10 | E-mails sent during this session
logon_fbacks | number | 3.10 | Feedback messages sent during this session
posts_read | number | 3.10 | Messages read during this session
menu_dir | string | 3.10 | Menu subdirectory (overrides default)
menu_file | string | 3.10 | Menu file (overrides default)
main_cmds | number | 3.10 | Total main menu commands received from user during this session
file_cmds | number | 3.10 | Total file menu commands received from user during this session
curgrp | number | 3.10 | Current message group
cursub | number | 3.10 | Current message sub-board
cursub_code | string | 3.14 | Current message sub-board internal code
curlib | number | 3.10 | Current file library
curdir | number | 3.10 | Current file directory
curdir_code | string | 3.14 | Current file directory internal code
connection | string | 3.10 | Remote connection type
rlogin_name | string | 3.10 | Login name given during RLogin negotiation
rlogin_password | string | 3.15 | Password specified during RLogin negotiation
rlogin_terminal | string | 3.16 | Terminal specified during RLogin negotiation
client_name | string | 3.10 | Client name
errorlevel | number | 3.12 | Error level returned from last executed external program
smb_group | string | 3.10 | Message group name of message being read
smb_group_desc | string | 3.10 | Message group description of message being read
smb_group_number | number | 3.10 | Message group number of message being read
smb_sub | string | 3.10 | Sub-board name of message being read
smb_sub_desc | string | 3.10 | Sub-board description of message being read
smb_sub_code | string | 3.10 | Sub-board internal code of message being read
smb_sub_number | number | 3.10 | Sub-board number of message being read
smb_attr | number | 3.10 | Message base attributes
smb_last_msg | number | 3.10 | Highest message number in message base
smb_total_msgs | number | 3.10 | Total number of messages in message base
smb_msgs | number | 3.10 | Number of messages loaded from message base
smb_curmsg | number | 3.10 | Current message number in message base
msg_to | string | 3.10 | Message recipient name
msg_to_ext | string | 3.10 | Message recipient extension
msg_to_net | string | 3.10 | Message recipient network address
msg_to_agent | number | 3.10 | Message recipient agent type
msg_from | string | 3.10 | Message sender name
msg_from_ext | string | 3.10 | Message sender extension
msg_from_net | string | 3.10 | Message sender network address
msg_from_bbsid | string | 3.18c | Message sender BBS ID
msg_from_agent | number | 3.10 | Message sender agent type
msg_replyto | string | 3.10 | Message reply-to name
msg_replyto_ext | string | 3.10 | Message reply-to extension
msg_replyto_net | string | 3.10 | Message reply-to network address
msg_replyto_agent | number | 3.10 | Message reply-to agent type
msg_subject | string | 3.10 | Message subject
msg_date | number | 3.10 | Message date/time
msg_timezone | number | 3.10 | Message time zone
msg_date_imported | number | 3.10 | Message date/time imported
msg_attr | number | 3.10 | Message attributes
msg_auxattr | number | 3.10 | Message auxiliary attributes
msg_netattr | number | 3.10 | Message network attributes
msg_offset | number | 3.10 | Message header offset
msg_number | number | 3.10 | Message number (unique, monotonically incrementing)
msg_expiration | number | 3.10 | Message expiration
msg_forwarded | number | 3.10 | Message forwarded
msg_thread_id | number | 3.16 | Message thread identifier (0 if unknown)
msg_thread_back | number | 3.12 | Message thread, back message number
msg_thread_next | number | 3.10 | Message thread, next message number
msg_thread_first | number | 3.10 | Message thread, message number of first reply to this message
msg_id | string | 3.10 | Message identifier
msg_reply_id | string | 3.10 | Message replied-to identifier
msg_delivery_attempts | number | 3.10 | Message delivery attempt counter
msghdr_top_of_screen | number | 3.17c | Message header displayed at top-of-screen
file_name | string | 3.17 | File name
file_description | string | 3.17 | File description
file_dir_number | string | 3.17 | File directory (number)
file_attr | string | 3.17 | File attribute flags
file_date | string | 3.17 | File date
file_size | string | 3.17 | File size (in bytes)
file_credits | string | 3.17 | File credit value
file_uploader | string | 3.17 | File uploader (user name)
file_upload_date | string | 3.17 | File upload date
file_download_date | string | 3.17 | File last-download date
file_download_count | string | 3.17 | File download count
download_cps | number | 3.20 | Most recent file download rate (in characters/bytes per second)
batch_upload_total | number | 3.10 | Number of files in batch upload queue
batch_dnload_total | number | 3.10 | Number of files in batch download queue
batch_dnload_bytes | number | 3.21 | Number of bytes in batch download queue
batch_dnload_cost | number | 3.21 | Cost (in credits) to download all files in batch download queue
batch_dnload_time | number | 3.21 | Estimated time (in seconds) to download all files in batch download queue
command_str | string | 3.14 | Current command shell/module command string value (see `STR` @-code)
optext | string | 3.21 | Optional text string to be displayed to user in a menu/text file (see `OPTEXT` @-code)

## console object
Controls the remote terminal - introduced in v3.10

`console` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
inkey | string | `console.inkey([k_mode=K_NONE] [,timeout=0])` | 3.11 | Get a single key with optional timeout in milliseconds (defaults to 0, for no wait). Returns an empty string (or `null` when the `K_NUL` k_mode flag is used) if there is no input (e.g. timeout occurs). See `K_*` in `sbbsdefs.js` for k_mode flags.
getkey | string | `console.getkey([k_mode=K_NONE])` | 3.10 | Get a single key, with wait. See `K_*` in `sbbsdefs.js` for k_mode flags.
getstr | string | `console.getstr([string default_value] [,number maxlen=128] [,number k_mode=K_NONE] [,array history[]])` | 3.10 | Get a text string from the user. See `K_*` in `sbbsdefs.js` for k_mode flags. history[] allows a command history (array of strings) to be recalled using the up/down arrow keys.
getnum | number | `console.getnum([number maxnum [,number default]])` | 3.10 | Get a number between 1 and maxnum from the user with a default value of default
getkeys | number | `console.getkeys([string keys] [,number> maxnum] [,number k_mode=K_UPPER])` | 3.10 | Get one key from of a list of valid command keys (any key, if not specified), or a number between 1 and maxnum
gettemplate | string | `console.gettemplate(string format [,string default_value] [,number k_mode=K_NONE])` | 3.10 | Get an input string based on specified template
ungetstr | boolean | `console.ungetstr(characters)` | 3.10 | Append characters into the receive input buffer
ungetkeys | boolean | `console.ungetkeys(characters [,bool insert=false])` | 3.20 | Insert or append characters (i.e. keys) into the remote keyboard input buffer
yesno | boolean | `console.yesno(question [,number p_mode=P_NONE])` | 3.10 | YES/no question - returns `true` if 'yes' is selected
noyes | boolean | `console.noyes(question [,number p_mode=P_NONE])` | 3.10 | NO/yes question - returns `true` if 'no' is selected
mnemonics | void | `console.mnemonics(text [,number p_mode=P_NONE])` | 3.10 | Print a mnemonics string, command keys highlighted with tilde (~) characters
clear | void | `console.clear([string or number attribute] [,bool autopause=true])` | 3.10 | Clear screen and home cursor, optionally setting current attribute first
home | void | `console.home()` | 3.11 | Send cursor to home position (x,y:1,1)
clearline | void | `console.clearline([attribute])` | 3.10 | Clear current line, optionally setting current attribute first
cleartoeol | void | `console.cleartoeol([attribute])` | 3.11 | Clear to end-of-line, optionally setting current attribute first
cleartoeos | void | `console.cleartoeos([attribute])` | 3.20c | Clear to end-of-screen, optionally setting current attribute first
newline | void | `console.newline([count=1])` | 3.10 | Output count number of new-line sequences (e.g. carriage-return/line-feed pairs), AKA `crlf() does perform pause`
cond_newline | void | `console.cond_newline()` | 3.20 | Output a new-line sequence only if the current cursor position is beyond left-most column of the terminal screen
cond_blankline | void | `console.cond_blankline()` | 3.20 | Output a new-line sequence followed by a second new-line sequence only if necessary to create a visible blank link
cond_contline | void | `console.cond_contline()` | 3.20 | Output a text continuation line (i.e. the LongLineContinuationPrefix text string) only if the current cursor position is beyond left-most column of a narrow (< 80 column) terminal screen
pause | boolean | `console.pause([bool set_abort=true])` | 3.10 | Display pause prompt and wait for key hit, returns `false` if user responded with Quit/Abort key. Passing `false` for the set_abort argument will prevent the ''console.aborted'' flag from being set by this method.
beep | void | `console.beep([count=1])` | 3.11 | Beep for count number of times (default count is 1)
print | void | `console.print([value [,value][...]] or [string text [,number p_mode=P_NONE]])` | 3.10 | Display one or more values as strings (supports Ctrl-A codes, Telnet-escaping, auto-screen pausing, etc.). Supports a limited set of `P_*` flags, e.g. `P_PETSCII` and `P_UTF8`.
write | void | `console.write(value [,value])` | 3.10 | Display one or more values as raw strings (may include NULs)
writeln | void | `console.writeln(value [,value])` | 3.15 | Display one or more values as raw strings followed by a single carriage-return/line-feed pair (new-line)
putmsg | void | `console.putmsg(text [,number p_mode=P_NONE] [,number orig_columns=0] [,object scope])` | 3.10 | Display message text (Ctrl-A codes, @-codes, pipe codes, etc.). See `P_*` in `sbbsdefs.js` for p_mode flags. When `P_WORDWRAP` p_mode flag is specified, orig_columns specifies the original text column width, if known. When scope is specified, `@JS:property@` codes will expand the referenced property names.
center | void | `console.center(text [,width])` | 3.10 | Display a string centered on the screen, with an optionally-specified screen width (in columns)
wide | void | `console.wide(text)` | 3.17c | Display a string double-wide on the screen (sending "fullwidth" Unicode characters when possible)
progress | void | `console.progress(text, count, total [,interval = 500])` | 3.19c | Display a progress indication bar, updated every interval milliseconds
strlen | number | `console.strlen(text [,p_mode=P_NONE])` | 3.10 | Returns the printed-length (number of columns) of the specified text, accounting for Ctrl-A codes and UNICODE zero/half/full-width characters
printfile | boolean | `console.printfile(filename [,number p_mode=P_NONE] [,number orig_columns=0] [,object scope])` | 3.10 | Print a message text file with optional print mode. When `P_WORDWRAP` p_mode flag is specified, orig_columns specifies the original text column width, if known. When scope is specified, `@JS:property@` codes will expand the referenced property names.
printtail | boolean | `console.printtail(filename, number lines [,number p_mode=P_NONE] [,number orig_columns=0] [,object scope])` | 3.10 | Print the last n lines of file with optional print mode, original column width, and scope.
editfile | boolean | `console.editfile(filename [,number maxlines=10000] [,number mode=WM_NONE] [,string to] [,string from] [,string subject] [,string msg_area] [,bool clean_quotes=true)` | 3.10 | Edit/create a text file using the user's preferred message editor with optional override values for the drop file created to communicate metadata to an external editor. See `sbbsdefs.js` for possible `WM_*` mode flags.
uselect | number | `console.uselect([number index, string title, string item] [,string ars])` | 3.12 | User selection menu: first call for each item, then finally with no arguments (or just the default item index number) to display a numbered-item selection menu/prompt. Returns the index of the selected item or a negative number (e.g. when aborted). See also the `uselect_count`, `uselect_title`, and `uselect_items` properties (new in v3.21).
saveline | boolean | `console.saveline()` | 3.10 | Push the current console line of text and attributes to a (local) LIFO list of saved lines
restoreline | boolean | `console.restoreline()` | 3.10 | Pop the most recently saved line of text and attributes and display it on the remote console
ansi | string | `console.ansi(attribute [,current_attribute])` | 3.10 | Returns ANSI sequence required to generate specified terminal attribute (e.g. `YELLOW|HIGH|BG_BLUE`), if current_attribute is specified, an optimized ANSI sequence may be returned
pushxy | boolean | `console.pushxy()` | 3.11 | Save the current cursor position (x and y coordinates) in the remote terminal
popxy | boolean | `console.popxy()` | 3.11 | Restore a saved cursor position to the remote terminal (requires terminal support, e.g. ANSI)
gotoxy | boolean | `console.gotoxy([x,y] or [object { x,y }])` | 3.11 | Move cursor to a specific screen coordinate (ANSI or PETSCII, 1-based values), arguments can be separate x and y coordinates or an object with x and y properties (like that returned from `console.getxy()`)
up | void | `console.up([rows=1])` | 3.11 | Move cursor up one or more rows
down | void | `console.down([rows=1])` | 3.11 | Move cursor down one or more rows
right | void | `console.right([columns=1])` | 3.11 | Move cursor right one or more columns
left | void | `console.left([columns=1])` | 3.11 | Move cursor left one or more columns
ansi_getdims | boolean | `console.ansi_getdims()` | 3.20 | Query the dimensions (rows and columns) of the remote ANSI terminal
getdimensions | void | `console.getdimensions()` | 3.20 | Get the dimensions of user's terminal, querying the remote terminal if possible/appropriate
getxy | object | `console.getxy()` | 3.11 | Query the current cursor position on the remote (ANSI) terminal and returns the coordinates as an object (with `x` and `y` properties) or `false` on failure
lock_input | void | `console.lock_input([lock=true])` | 3.10 | Lock the user input thread (allowing direct client socket access)
telnet_cmd | boolean | `console.telnet_cmd(command [,option=0] [,timeout=0])` | 3.17 | Send Telnet command (with optional command option) to remote client, if the optional timeout is specified (in milliseconds), then an acknowledgment will be expected and the return value will indicate whether or not one was received
handle_ctrlkey | boolean | `console.handle_ctrlkey(key [,k_mode=K_NONE])` | 3.11 | Call internal control key handler for specified control key, returns `true` if handled
term_supports | boolean | `console.term_supports([terminal_flags])` | 3.14 | Either returns bool, indicating whether or not the current user/client supports all the specified terminal_flags, or returns the current user/client's terminal_flags (numeric bit-field) if no terminal_flags were specified
term_updated | boolean | `console.term_updated()` | 3.18c | Update the node's `terminal.ini` file to match the current terminal settings
backspace | void | `console.backspace([count=1])` | 3.15 | Send a destructive backspace sequence
creturn | void | `console.creturn()` | 3.17 | Send carriage-return (or equivalent) character(s) - moving the cursor to the left-most screen column
linefeed | void | `console.linefeed([count=1])` | 3.20 | Send line-feed (or equivalent) character(s) - moving the cursor down one or more screen rows, does not cause a pause
clearkeybuffer | void | `console.clearkeybuffer()` | 3.15 | Clear keyboard input buffer
getbyte | number | `console.getbyte([timeout=0])` | 3.17 | Returns an unprocessed input byte from the remote terminal with optional timeout in milliseconds (defaults to 0, for no wait), returns null on failure (timeout)
putbyte | boolean | `console.putbyte(value)` | 3.17 | Sends an unprocessed byte value to the remote terminal
add_hotspot | void | `console.add_hotspot(cmd [,bool hungry=true] [,min_x] [,max_x] [,y])` | 3.18 | Adds a mouse hot-spot (a click-able screen area that generates keyboard input)
clear_hotspots | void | `console.clear_hotspots()` | 3.18 | Clear all current mouse hot-spots
scroll_hotspots | void | `console.scroll_hotspots([rows=1])` | 3.18 | Scroll all current mouse hot-spots by the specific number of rows
on | number | `console.on(type, callback)` | 3.19 | Calls callback whenever the condition type specifies is possible. Currently, only 'read' is supported for type. Returns an id suitable for use with clearOn
once | number | `console.once(type, callback)` | 3.19 | Calls callback the first time the condition type specifies is possible. Currently, only 'read' is supported for type. Returns an id suitable for use with clearOnce
clearOn | void | `console.clearOn(type, id)` | 3.19 | Removes a callback installed by on
clearOnce | void | `console.clearOnce(type, id)` | 3.19 | Removes a callback installed by once
flush | void | `console.flush()` | 3.19c | Flushes the output buffer

`console` properties
Name | Type | Ver | Description
--- | --- | --- | ---
color_list | object | N/A | Array of text colors (in IBM CGA attribute format), as configured in the `attr.ini` file
uselect_items | object | N/A | Array of items (each with a `name` and `num` property) enqueued via the `uselect()` method for user selection
status | number | 3.10 | Status bit-field (see `CON_*` in `sbbsdefs.js` for bit definitions)
mouse_mode | number | 3.18 | Mouse mode bit-field (see `MOUSE_MODE_*` in `sbbsdefs.js` for bit definitions, set to `true` for default enabled mode, `false` to disable)
line_counter | number | 3.10 | Current 0-based line counter (used for automatic screen pause)
current_row | number | 3.18 | Current 0-based row position, set to move cursor
current_column | number | 3.15 | Current 0-based column position, set to move cursor
last_line_length | number | 3.17 | Column the cursor was on when last CR was sent to terminal or the line wrapped
line_delay | number | 3.20 | Duration of delay (in milliseconds) before each line-feed character is sent to the terminal
attributes | number | 3.10 | Current display attributes (set with number or string value)
top_of_screen | number | 3.10 | `true` if the terminal cursor is already at the top of the screen - READ ONLY
screen_rows | number | 3.10 | Number of remote terminal screen rows (in lines)
screen_columns | number | 3.11 | Number of remote terminal screen columns (in character cells)
tabstop | number | 3.17 | Current tab stop interval (tab size), in columns
autoterm | number | 3.10 | Bit-field of automatically detected terminal settings (see `USER_*` in `sbbsdefs.js` for bit definitions)
terminal | string | 3.11 | Terminal type description, possibly supplied by client (e.g. 'ANSI')
type | string | 3.17c | Terminal type (i.e. 'ANSI', 'RIP', 'PETSCII', or 'DUMB')
charset | string | 3.17c | Terminal character set (i.e. 'UTF-8', 'CP437', 'CBM-ASCII', or 'US-ASCII')
unicode_zerowidth | number | 3.20 | Detected width of 'ZERO-WIDTH' UNICODE characters, in columns (either 0 or 1)
cterm_version | number | 3.17 | Detected CTerm (SyncTERM) version as an integer > 1000 where major version is cterm_version / 1000 and minor version is cterm_version % 1000
max_getkey_inactivity | number | 3.20 | Number of seconds before disconnection due to user/keyboard inactivity (in getkey/getstr)
getkey_inactivity_warning | number | 3.20c | Number of seconds before warning the user of pending disconnection due to user/keybard inactivity (or 0 if disabled)
last_getkey_activity | number | 3.20 | User/keyboard inactivity timeout reference value (time_t format)
max_socket_inactivity | number | 3.20 | Number of seconds before disconnection due to socket inactivity (in input_thread)
timeleft_warning | number | 3.10 | Number of low time-left (5 or fewer minutes remaining) warnings displayed to user
aborted | boolean | 3.10 | Input/output has been aborted
abortable | boolean | 3.10 | Remote output can be asynchronously aborted with Ctrl-C
telnet_mode | number | 3.10 | Current Telnet mode bit-field (see `TELNET_MODE_*` in `sbbsdefs.js` for bit definitions)
wordwrap | string | 3.10 | Word-wrap buffer (used by getstr) - READ ONLY
question | string | 3.10 | Current yes/no question (set by yesno and noyes)
getstr_offset | number | 3.11 | Cursor position offset for use with `getstr(K_USEOFFSET)`
ctrlkey_passthru | number | 3.10 | Control key pass-through bit-mask, set bits represent control key combinations not handled by `inkey()` method. This may optionally be specified as a string of characters. The format of this string is [+-][@-_]. If neither plus nor minus is the first character, the value will be replaced by one constructed from the string. A + indicates that characters following will be added to the set, and a - indicates they should be removed. ex: `console.ctrlkey_passthru="-UP+AB"` will clear CTRL-U and CTRL-P and set CTRL-A and CTRL-B.
optimize_gotoxy | number | 3.21 | Set to `true` to avoid sending redundant cursor position changes to the terminal
uselect_title | string | 3.21 | Title to display in user selection prompts (via `uselect()`)
uselect_count | number | 3.21 | Number of items currently enqueued for a user selection prompt (via `uselect()`) - Can be decreased only
input_buffer_level | number | 3.12 | Number of bytes currently in the input buffer (from the remote client) - READ ONLY
input_buffer_space | number | 3.12 | Number of bytes available in the input buffer - READ ONLY
output_buffer_level | number | 3.12 | Number of bytes currently in the output buffer (from the local server) - READ ONLY
output_buffer_space | number | 3.12 | Number of bytes available in the output buffer - READ ONLY
output_rate | number | 3.17c | Emulated serial data output rate, in bits-per-second (0 = unlimited)
keyboard_buffer_level | number | 3.18 | Number of characters currently in the keyboard input buffer (from `ungetkeys`) - READ ONLY
keyboard_buffer_space | number | 3.18 | Number of character spaces available in the keyboard input buffer - READ ONLY
yes_key | string | 3.20 | Key associated with a positive acknowledgment (e.g. 'Y') - READ ONLY
no_key | string | 3.20 | Key associated with a negative acknowledgment (e.g. 'N') - READ ONLY
quit_key | string | 3.20 | Key associated with a exiting a menu (e.g. 'Q') - READ ONLY
all_key | string | 3.20 | Key associated with selecting all available options (e.g. 'A') - READ ONLY
list_key | string | 3.20 | Key associated with listing all available options (e.g. 'L') - READ ONLY
next_key | string | 3.20 | Key associated with selecting next available option (e.g. 'N') - READ ONLY
prev_key | string | 3.20 | Key associated with selecting previous available option (e.g. 'P') - READ ONLY

## msg_area object
Message Areas - introduced in v3.10

`msg_area` properties
Name | Type | Description
--- | --- | ---
settings | number | Message area settings (bit-flags) - see `MM_*` in `sbbsdefs.js` for details
fido_netmail_settings | number | FidoNet NetMail settings (bit-flags) - see `NMAIL_*` in `sbbsdefs.js` for details
inet_netmail_settings | number | Internet NetMail settings (bit-flags) - see `NMAIL_*` in `sbbsdefs.js` for details

## msg_area.grp object
Associative array of all groups (use name as index) - introduced in v3.12

## msg_area.sub object
Associative array of all sub-boards (use internal code as index) - introduced in v3.11

## msg_area.grp_list array
Message Groups (current user has access to) - introduced in v3.10

`msg_area.grp_list` properties
Name | Type | Description
--- | --- | ---
index | number | Index into grp_list array (or -1 if not in array)
number | number | Unique (zero-based) number for this message group
name | string | Group name
description | string | Group description
ars | string | Group access requirements
can_access | boolean | User has sufficient access to list this group's sub-boards
code_prefix | string | Internal code prefix (for sub-boards)

## msg_area.grp_list.sub_list array
Message Sub-boards (current user has access to)

(all properties are READ ONLY except for scan_ptr, scan_cfg, and last_read) - introduced in v3.10

`msg_area.grp_list.sub_list` properties
Name | Type | Description
--- | --- | ---
index | number | Index into sub_list array (or -1 if not in array)
grp_index | number | Group's index into grp_list array
number | number | Unique (zero-based) number for this sub-board
grp_number | number | Group number
grp_name | string | Group name
code | string | Sub-board internal code
name | string | Sub-board name
description | string | Sub-board description
qwk_name | string | QWK conference name
area_tag | string | Area tag for FidoNet-style echoes, a.k.a. EchoTag
newsgroup | string | Newsgroup name (as configured or dynamically generated)
ars | string | Sub-board access requirements
read_ars | string | Sub-board reading requirements
post_ars | string | Sub-board posting requirements
operator_ars | string | Sub-board operator requirements
moderated_ars | string | Sub-board moderated-user requirements (if non-blank)
data_dir | string | Sub-board data storage location
fidonet_addr | string | FidoNet node address
fidonet_origin | string | FidoNet origin line
qwknet_tagline | string | QWK Network tagline
settings | number | Toggle options (bit-flags) - see `SUB_*` in `sbbsdefs.js` for details
ptridx | number | Index into message scan configuration/pointer file
qwk_conf | number | QWK conference number
max_crcs | number | Configured maximum number of message CRCs to store (for dupe checking)
max_msgs | number | Configured maximum number of messages before purging
max_age | number | Configured maximum age (in days) of messages before expiration
print_mode | number | Additional print mode flags to use when printing messages - see `P_*` in `sbbsdefs.js` for details
print_mode_neg | number | Print mode flags to negate when printing messages - see `P_*` in `sbbsdefs.js` for details
can_access | boolean | User has sufficient access to see this sub-board
can_read | boolean | User has sufficient access to read messages in this sub-board
can_post | boolean | User has sufficient access to post messages in this sub-board
is_operator | boolean | User has operator access to this sub-board
is_moderated | boolean | User's posts are moderated
scan_ptr | undefined | User's current new message scan pointer (highest-read message number)
scan_cfg | undefined | User's message scan configuration (bit-flags) - see `SCAN_CFG_*` in `sbbsdefs.js` for details
last_read | undefined | User's last-read message number
posts | number | Number of messages currently posted to this sub-board

## file_area object
File Transfer Areas - introduced in v3.10

`file_area` properties
Name | Type | Description
--- | --- | ---
min_diskspace | number | Minimum amount of available disk space (in bytes) required for user uploads to be allowed
max_filename_length | number | Maximum allowed length of filenames (in characters) uploaded by users
settings | number | File area settings (bit-flags) - see `FM_*` in `sbbsdefs.js` for details
web_vpath_prefix | string | Web file virtual path prefix

## file_area.lib object
Associative array of all libraries (use name as index) - introduced in v3.12

## file_area.dir object
Associative array of all directories (use internal code as index) - introduced in v3.11

## file_area.lib_list array
File Transfer Libraries (current user has access to) - introduced in v3.10

`file_area.lib_list` properties
Name | Type | Description
--- | --- | ---
index | number | Index into lib_list array (or -1 if not in array)
number | number | Unique (zero-based) number for this library
name | string | Name
description | string | Description
ars | string | Access requirements
vdir | string | Virtual directory name (for FTP or Web access)
can_access | boolean | User has sufficient access to this library's directories
code_prefix | string | Internal code prefix (for directories)

## file_area.lib_list.dir_list array
File Transfer Directories (current user has access to) - introduced in v3.10

`file_area.lib_list.dir_list` properties
Name | Type | Description
--- | --- | ---
index | number | Index into dir_list array (or -1 if not in array)
number | number | Unique (zero-based) number for this directory
lib_index | number | Library index
lib_number | number | Library number
lib_name | string | Library name
code | string | Directory internal code
name | string | Directory name
description | string | Directory description
area_tag | string | Directory area tag for file echoes
path | string | Directory file storage location
ars | string | Directory access requirements
upload_ars | string | Directory upload requirements
download_ars | string | Directory download requirements
exempt_ars | string | Directory exemption requirements
operator_ars | string | Directory operator requirements
extensions | string | Allowed file extensions (comma delimited)
upload_sem | string | Upload semaphore file
data_dir | string | Directory data storage location
settings | number | Toggle options (bit-flags)
seqdev | number | Sequential (slow storage) device number
sort | number | Sort order (see `FileBase.SORT` for valid values)
max_files | number | Configured maximum number of files
max_age | number | Configured maximum age (in days) of files before expiration
upload_credit_pct | number | Percent of file size awarded uploader in credits upon file upload
download_credit_pct | number | Percent of file size awarded uploader in credits upon subsequent downloads
vdir | string | Virtual directory name (for FTP or Web access)
vpath | string | Virtual path (for FTP or Web access), with trailing slash
files | number | Number of files currently in this directory
update_time | number | Time-stamp of file base index of this directory
can_access | boolean | User has sufficient access to view this directory (e.g. list files)
can_upload | boolean | User has sufficient access to upload files to this directory
can_download | boolean | User has sufficient access to download files from this directory
is_exempt | boolean | User is exempt from download credit costs (or the directory is configured for free downloads)
is_operator | boolean | User has operator access to this directory
vshortcut | string | Virtual shortcut (for FTP or Web access), optional
is_offline | boolean | Directory is for off-line storage
is_upload | boolean | Directory is for uploads only
is_sysop | boolean | Directory is for uploads to sysop only

## xtrn_area object
External Program Areas - introduced in v3.10

## xtrn_area.sec object
Associative array of all external program sections (use internal code as index) - introduced in v3.12

## xtrn_area.prog object
Associative array of all external programs (use internal code as index) - introduced in v3.11

## xtrn_area.sec_list array
Online Program (door) Sections (current user has access to) - introduced in v3.10

`xtrn_area.sec_list` properties
Name | Type | Description
--- | --- | ---
index | number | Index into sec_list array (or -1 if not in index)
number | number | Unique number for this external program section
code | string | External program section internal code
name | string | External program section name
ars | string | External program section access requirements
can_access | boolean | User has sufficient access to enter this section

## xtrn_area.sec_list.prog_list array
Online External Programs (doors) (current user has access to) - introduced in v3.10

`xtrn_area.sec_list.prog_list` properties
Name | Type | Description
--- | --- | ---
index | number | Index into prog_list array (or -1 if not in index)
number | number | Program number
sec_index | number | Program section index
sec_number | number | Program section number
sec_code | string | Program section internal code
code | string | Internal code
name | string | Name
cmd | string | Command-line
clean_cmd | string | Clean-up command-line
startup_dir | string | Startup directory
ars | string | Access requirements
execution_ars | string | Execution requirements
settings | number | Toggle options (bit-flags)
type | number | Drop file type
event | number | Event type (0=none)
textra | number | Extra time given to users running this program
max_time | number | Maximum time allowed in program
cost | number | Execution cost (credits to run this program)
can_access | boolean | User has sufficient access to see this program
can_run | boolean | User has sufficient access to run this program

## xtrn_area.event object
Associative array of all timed events (use internal code as index) - introduced in v3.11

`xtrn_area.event` properties
Name | Type | Ver | Description
--- | --- | --- | ---
cmd | string | 3.11 | Command-line
startup_dir | string | 3.11 | Startup directory
node_num | number | 3.11 | Node number
time | number | 3.11 | Time to execute (minutes since midnight)
freq | number | 3.11 | Frequency to execute
days | number | 3.11 | Days of week to execute (bit-flags)
mdays | number | 3.11 | Days of month to execute (bit-flags)
months | number | 3.11 | Months of year to execute (bit-flags)
last_run | number | 3.11 | Date/time of last run (in time_t format)
next_run | number | 3.18c | Date/time of next run (in time_t format)
error_level | number | 3.18c | Error log level
settings | number | 3.11 | Toggle options (bit-flags)

## xtrn_area.editor object
Associative array of all external editors (use internal code as index) - introduced in v3.11

`xtrn_area.editor` properties
Name | Type | Description
--- | --- | ---
name | string | Name
cmd | string | Command-line
ars | string | Access requirements
settings | number | Toggle options (bit-flags)
type | number | Drop file type

## User class
Class used to represent a user of the system. See also the global `user` object, representing current user online. - introduced in v3.10

To create a new user object: `var u = new User;` or: `var u = new User(number);`

`User` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
compare_ars | boolean | `User.compare_ars(requirements)` | 3.10 | Verify and return `true` if user meets the specified access requirements string.true when passed `nullptr`, `undefined`, or an empty string. Note: For the current user of the terminal server, use `bbs.compare_ars()` instead.
adjust_credits | boolean | `User.adjust_credits(count)` | 3.14 | Adjust user's credits by count (negative to subtract).
adjust_minutes | boolean | `User.adjust_minutes(count)` | 3.14 | Adjust user's extra minutes count (negative to subtract).
posted_message | boolean | `User.posted_message([count])` | 3.14 | Adjust user's posted-messages statistics by count (default: 1) (negative to subtract).
sent_email | boolean | `User.sent_email([count] [,bool feedback])` | 3.14 | Adjust user's email/feedback-sent statistics by count (default: 1) (negative to subtract).
uploaded_file | boolean | `User.uploaded_file([bytes] [,files])` | 3.14 | Adjust user's files/bytes-uploaded statistics.
downloaded_file | boolean | `User.downloaded_file([dir-code] [file path | name] [bytes] [,file-count])` | 3.18 | Handle the full or partial successful download of a file. Adjust user's files/bytes-downloaded statistics and credits, file's stats, system's stats, and uploader's stats and credits.
get_time_left | number | `User.get_time_left(start_time)` | 3.14b | Return the user's available remaining time online, in seconds, based on the passed start_time value (in time_t format). Note: this method does not account for pending forced timed events. Note: for the pre-defined user object on the BBS, you almost certainly want bbs.get_time_left() instead.
can_access_sub | boolean | `User.can_access_sub(string sub_code or number sub_num, ['read', 'post', or 'operator'])` | 3.21 | Return `true` if the user has the specified access to the specified message sub-board. If no access string (second argument) is specified, any access is checked.
can_access_dir | boolean | `User.can_access_dir(string dir_code or number dir_num, ['download', 'upload', or 'operator'])` | 3.21 | Return `true` if the user has the specified access to the specified file directory. If no access string (second argument) is specified, any access is checked.
close | void | `User.close()` | 3.19c | Close the `user.tab` file, if open. The file will be automatically reopened if necessary.

`User` properties
Name | Type | Ver | Description
--- | --- | --- | ---
number | number | 3.10 | Record number (1-based)
alias | string | 3.10 | Alias/name
name | string | 3.10 | Real name
handle | string | 3.10 | Chat handle
lang | string | 3.20 | Language code (blank, if default, e.g. English)
note | string | 3.10 | Sysop note
ip_address | string | 3.10 | IP address last logged-in from
host_name | string | 3.10 | Host name last logged-in from (AKA `computer`)
comment | string | 3.10 | Sysop's comment
netmail | string | 3.10 | External e-mail address
email | string | 3.10 | Local Internet e-mail address - READ ONLY
address | string | 3.10 | Street address
location | string | 3.10 | Location (e.g. city, state)
zipcode | string | 3.10 | Zip/postal code
phone | string | 3.10 | Phone number
birthdate | string | 3.10 | Birth date in 'YYYYMMDD' format or legacy format: 'MM/DD/YY' or 'DD/MM/YY', depending on system configuration
birthyear | number | 3.18c | Birth year
birthmonth | number | 3.18c | Birth month (1-12)
birthday | number | 3.18c | Birth day of month (1-31)
age | number | 3.10 | Calculated age in years - READ ONLY
connection | string | 3.10 | Connection type (protocol, AKA `modem`)
screen_rows | number | 3.10 | Terminal rows (0 = auto-detect)
screen_columns | number | 3.18c | Terminal columns (0 = auto-detect)
gender | string | 3.10 | Gender type (e.g. M or F or any single-character)
cursub | string | 3.10 | Current/last message sub-board (internal code)
curdir | string | 3.10 | Current/last file directory (internal code)
curxtrn | string | 3.10 | Current/last external program (internal code) run
editor | string | 3.10 | External message editor (internal code) or blank if none
command_shell | string | 3.10 | Command shell (internal code)
settings | number | 3.10 | Settings bit-flags - see `USER_*` in `sbbsdefs.js` for bit definitions
qwk_settings | number | 3.10 | QWK packet settings bit-flags - see `QWK_*` in `sbbsdefs.js` for bit definitions
chat_settings | number | 3.10 | Chat settings bit-flags - see `CHAT_*` in `sbbsdefs.js` for bit definitions
mail_settings | number | 3.20 | Mail settings bit-flags - see `MAIL_*` in `sbbsdefs.js` for bit definitions
temp_file_ext | string | 3.10 | Temporary file type (extension)
new_file_time | number | 3.11 | New file scan date/time (time_t format)
download_protocol | string | 3.10 | File transfer protocol (command key)
logontime | number | 3.10 | Logon time (time_t format)
cached | boolean | 3.14 | Record is currently cached in memory
is_sysop | boolean | 3.15 | User has a System Operator's security level
is_guest | boolean | 3.21 | User has the 'Guest' restrction
is_active | boolean | 3.21 | User account is active, not deleted or marked inactive
batch_upload_list | string | 3.20 | Batch upload list file path/name
batch_download_list | string | 3.20 | Batch download list file path/name

## User.stats object
User statistics (all READ ONLY) - introduced in v3.10

`User.stats` properties
Name | Type | Ver | Description
--- | --- | --- | ---
laston_date | number | 3.10 | Date of previous logon (time_t format)
firston_date | number | 3.10 | Date of first logon (time_t format)
total_logons | number | 3.10 | Total number of logons
logons_today | number | 3.10 | Total logons today
total_timeon | number | 3.10 | Total time used (in minutes)
timeon_today | number | 3.10 | Time used today (in minutes)
timeon_last_logon | number | 3.10 | Time used last session (in minutes)
total_posts | number | 3.10 | Total messages posted
total_emails | number | 3.10 | Total e-mails sent
total_feedbacks | number | 3.10 | Total feedback messages sent
email_today | number | 3.10 | E-mail sent today
posts_today | number | 3.10 | Messages posted today
bytes_downloaded_today | number | 3.21 | Bytes downloaded today
files_downloaded_today | number | 3.21 | Files downloaded today
bytes_uploaded | number | 3.10 | Total bytes uploaded
files_uploaded | number | 3.10 | Total files uploaded
bytes_downloaded | number | 3.10 | Total bytes downloaded
files_downloaded | number | 3.10 | Total files downloaded
download_cps | number | 3.20 | Latest average download rate, in characters (bytes) per second
leech_attempts | number | 3.10 | Suspected leech downloads
mail_waiting | number | 3.12 | Total number of e-mail messages currently waiting in inbox
read_mail_waiting | number | 3.18c | Number of read e-mail messages currently waiting in inbox
unread_mail_waiting | number | 3.18c | Number of unread e-mail messages currently waiting in inbox
spam_waiting | number | 3.18c | Number of SPAM e-mail messages currently waiting in inbox
mail_pending | number | 3.12 | Number of e-mail messages sent, currently pending deletion

## User.security object
User security settings - introduced in v3.10

`User.security` properties
Name | Type | Ver | Description
--- | --- | --- | ---
password | string | 3.10 | Password
password_date | number | 3.10 | Date password last modified (time_t format)
level | number | 3.10 | Security level (0-99)
flags1 | number | 3.10 | Flag set #1 (bit-flags) can use +/-[A-?] notation
flags2 | number | 3.10 | Flag set #2 (bit-flags) can use +/-[A-?] notation
flags3 | number | 3.10 | Flag set #3 (bit-flags) can use +/-[A-?] notation
flags4 | number | 3.10 | Flag set #4 (bit-flags) can use +/-[A-?] notation
exemptions | number | 3.10 | Exemption flags (bit-flags) can use +/-[A-?] notation
restrictions | number | 3.10 | Restriction flags (bit-flags) can use +/-[A-?] notation
credits | number | 3.10 | Credits
free_credits | number | 3.10 | Free credits (for today only)
minutes | number | 3.10 | Extra minutes (time bank)
extra_time | number | 3.10 | Extra minutes (for today only)
expiration_date | number | 3.10 | Expiration date/time (time_t format)
deletion_date | number | 3.20c | Deletion date/time (time_t format) - READ ONLY

## User.limits object
User limitations based on security level (all READ ONLY) - introduced in v3.11

`User.limits` properties
Name | Type | Ver | Description
--- | --- | --- | ---
time_per_logon | number | 3.11 | Time (in minutes) per logon
time_per_day | number | 3.11 | Time (in minutes) per day
logons_per_day | number | 3.11 | Logons per day
lines_per_message | number | 3.11 | Lines per message (post or email)
email_per_day | number | 3.11 | Email sent per day
posts_per_day | number | 3.11 | Messages posted per day
free_credits_per_day | number | 3.11 | Free credits given per day
file_downloads_per_day | number | 3.21 | File downloads per day (0=Unlimited)

## MsgBase class
Class used for accessing message bases - introduced in v3.10

To create a new MsgBase object: `var msgbase = new MsgBase(string code_or_path, [bool is_path=false])`
where code_or_path is a sub-board internal code, or `'mail'` for the e-mail message base.
When is_path is `true`, the string parameter specifies the path to a message base (not an internal code) - new behavior in v3.21.

The MsgBase retrieval methods that accept a `by_offset` argument as their optional first boolean argument will interpret the following number argument as either a 1-based unique message number (by_offset=`false`) or a 0-based message index-offset (by_offset=`true`). Retrieving messages by offset is faster than by number or message-id (string). Passing an existing message header object to the retrieval methods that support it (e.g. `get_msg_body()`) is even faster.

`MsgBase` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
open | boolean | `MsgBase.open()` | 3.10 | Open message base
close | boolean | `MsgBase.close()` | 3.10 | Close message base (if open)
get_msg_header | object | `MsgBase.get_msg_header([bool by_offset=false,] number number_or_offset or string id [,bool expand_fields=true] [,bool include_votes=false])` | 3.12 | Return a specific message header, null on failure. Pass false for the expand_fields argument (default: true) if you will be re-writing the header later with put_msg_header() Additional read-only header properties: mime_version, content_type, and is_utf8
get_all_msg_headers | object | `MsgBase.get_all_msg_headers([bool include_votes=false] [,bool expand_fields=true])` | 3.16 | Return an object (associative array) of all message headers "indexed" by message number. Message headers returned by this function include additional properties: `upvotes`, `downvotes` and `total_votes`. Vote messages are excluded by default.
put_msg_header | boolean | `MsgBase.put_msg_header([bool by_offset=false,] [number number_or_offset or string id,] object header)` | 3.10 | Modify an existing message header (must have been 'got' without expanded fields)
get_msg_body | string | `MsgBase.get_msg_body([bool by_offset=false,] number number_or_offset or string id or object header [,bool strip_ctrl_a=false] [,bool dot_stuffing=false] [,bool include_tails=true] [,bool plain_text=false])` | 3.10 | Return the entire body text of a specific message as a single string or null on failure. The default behavior is to leave Ctrl-A codes intact, do not stuff dots (e.g. per RFC-821), and to include tails (if any) in the returned body text. When plain_text is true, only the first plain-text portion of a multi-part MIME encoded message body is returned. The first argument (following the optional by_offset boolean) must be either a number (message number or index-offset), string (message-ID), or object (message header). The by_offset (`true`) argument should only be passed when the argument following it is the numeric index-offset of the message to be retrieved. By default (by_offset=`false`), a numeric argument would be interpreted as the message number to be retrieved. After reading a multi-part MIME-encoded message, new header properties may be available: text_charset and text_subtype.
get_msg_tail | string | `MsgBase.get_msg_tail([bool by_offset=false,] number number_or_offset or string id or object header [,bool strip_ctrl_a=false])` | 3.10 | Return the tail text of a specific message, null on failure
get_msg_index | object | `MsgBase.get_msg_index([bool by_offset=false,] number number_or_offset, [bool include_votes=false])` | 3.11 | Return a specific message index record, null on failure. The index object will contain the following properties:
`attr` | Attribute bit-flags
`time` | Date/time imported (in time_t format)
`number` | Message number
`offset` | Record number in index file
Indexes of regular messages will contain the following additional properties:
`subject` | CRC-16 of lowercase message subject
`to` | CRC-16 of lowercase recipient's name (or user number if e-mail)
`from` | CRC-16 of lowercase sender's name (or user number if e-mail)
Indexes of vote messages will contain the following additional properties:
`vote` | vote value
`remsg` | number of message this vote is in response to
get_index | array | `MsgBase.get_index()` | 3.17c | Return an array of message index records represented as objects, the same format as returned by get_msg_index() This is the fastest method of obtaining a list of all message index records.
remove_msg | boolean | `MsgBase.remove_msg([bool by_offset=false,] number number_or_offset or string id)` | 3.11 | Mark message for deletion
save_msg | boolean | `MsgBase.save_msg(object header [,object client=none] [,body_text=""] [,array rcpt_list=none])` | 3.12 | Create a new message in message base. The header object may contain the following properties:
`subject` | Message subject (required)
`to` | Recipient's name (required)
`to_ext` | Recipient's user number (for local e-mail)
`to_org` | Recipient's organization
`to_net_type` | Recipient's network type (default: 0 for local)
`to_net_addr` | Recipient's network address
`to_agent` | Recipient's agent type
`to_list` | Comma-separated list of primary recipients, RFC822-style
`cc_list` | Comma-separated list of secondary recipients, RFC822-style
`from` | Sender's name (required)
`from_ext` | Sender's user number
`from_org` | Sender's organization
`from_net_type` | Sender's network type (default: 0 for local)
`from_net_addr` | Sender's network address
`from_agent` | Sender's agent type
`from_ip_addr` | Sender's IP address (if available, for security tracking)
`from_host_name` | Sender's host name (if available, for security tracking)
`from_protocol` | TCP/IP protocol used by sender (if available, for security tracking)
`from_port` | TCP/UDP port number used by sender (if available, for security tracking)
`sender_userid` | Sender's user ID (if available, for security tracking)
`sender_server` | Server's host name (if available, for security tracking)
`sender_time` | Time/Date message was received from sender (if available, for security tracking)
`replyto` | Replies should be sent to this name
`replyto_ext` | Replies should be sent to this user number
`replyto_org` | Replies should be sent to organization
`replyto_net_type` | Replies should be sent to this network type
`replyto_net_addr` | Replies should be sent to this network address
`replyto_agent` | Replies should be sent to this agent type
`replyto_list` | Comma-separated list of mailboxes to reply-to, RFC822-style
`mime_version` | MIME Version (optional)
`content_type` | MIME Content-Type (optional)
`summary` | Message Summary (optional)
`editor` | Message Editor used by author (optional)
`tags` | Message Tags (space-delimited, optional)
`id` | Message's RFC-822 compliant Message-ID
`reply_id` | Message's RFC-822 compliant Reply-ID
`reverse_path` | Message's SMTP sender address
`forward_path` | Argument to SMTP 'RCPT TO' command
`path` | Messages's NNTP path
`newsgroups` | Message's NNTP newsgroups header
`ftn_msgid` | FidoNet FTS-9 Message-ID
`ftn_reply` | FidoNet FTS-9 Reply-ID
`ftn_area` | FidoNet FTS-4 echomail AREA tag
`ftn_flags` | FidoNet FSC-53 FLAGS
`ftn_pid` | FidoNet FSC-46 Program Identifier
`ftn_tid` | FidoNet FSC-46 Tosser Identifier
`ftn_charset` | FidoNet FTS-5003 Character Set Identifier
`date` | RFC-822 formatted date/time
`attr` | Attribute bit-flags
`auxattr` | Auxiliary attribute bit-flags
`netattr` | Network attribute bit-flags
`when_written_time` | Date/time (in time_t format)
`when_written_zone` | Time zone (in SMB format)
`when_written_zone_offset` | Time zone in minutes east of UTC
`when_imported_time` | Date/time message was imported
`when_imported_zone` | Time zone (in SMB format)
`when_imported_zone_offset` | Time zone in minutes east of UTC
`thread_id` | Thread identifier (originating message number)
`thread_back` | Message number that this message is a reply to
`thread_next` | Message number of the next reply to the original message in this thread
`thread_first` | Message number of the first reply to this message
`votes` | Bit-field of votes if ballot, maximum allowed votes per ballot if poll
`priority` | Priority value following the X-Priority email header schcme (1 = highest, 3 = normal, 5 = lowest, 0 = unspecified)
`delivery_attempts` | Number of failed delivery attempts (e.g. over SMTP)
`field_list[].type` | Other SMB header fields (type)
`field_list[].data` | Other SMB header fields (data)
`can_read` | true if the current user can read this validated or unmoderated message
The optional client argument is an instance of the Client class to be used for the security log header fields (e.g. sender IP address, hostname, protocol, and port). The global client object will be used if this parameter is omitted. The optional rcpt_list is an array of objects that specifies multiple recipients for a single message (e.g. bulk e-mail). Each recipient object in the array may include the following header properties (described above): to, to_ext, to_org, to_net_type, to_net_addr, and to_agent
vote_msg | boolean | `MsgBase.vote_msg(object header)` | 3.17 | Create a new vote in message base. The header object should contain the following properties:
`from` | Sender's name (required)
`from_ext` | Sender's user number (if applicable)
`from_net_type` | Sender's network type (default: 0 for local)
`from_net_addr` | Sender's network address
`reply_id` | The Reply-ID of the message being voted on (or specify thread_back)
`thread_back` | Message number of the message being voted on
`attr` | Should be either MSG_UPVOTE, MSG_DOWNVOTE, or MSG_VOTE (if answer to poll)
add_poll | boolean | `MsgBase.add_poll(object header)` | 3.17 | Create a new poll in message base. The header object should contain the following properties:
`subject` | Polling question (required)
`from` | Sender's name (required)
`from_ext` | Sender's user number (if applicable)
`from_net_type` | Sender's network type (default: 0 for local)
`from_net_addr` | Sender's network address
close_poll | boolean | `MsgBase.close_poll(message number, user name or alias)` | 3.17 | Close an existing poll
how_user_voted | number | `MsgBase.how_user_voted(message number, user name or alias)` | 3.17 | Return 0 for no votes, 1 for an up-vote, 2 for a down-vote, or in the case of a poll-response: a bit-field of votes.
dump_msg_header | array | `MsgBase.dump_msg_header(object header)` | 3.17c | Dump a message header object to an array of strings for diagnostic uses

`MsgBase` properties
Name | Type | Ver | Description
--- | --- | --- | ---
error | string | 3.10 | Last occurred message base error - READ ONLY
status | number | 3.12 | Return value of last SMB Library function call - READ ONLY
file | string | 3.10 | Base path and filename of message base - READ ONLY
retry_time | number | 3.10 | Message base open/lock retry timeout (in seconds)
retry_delay | number | 3.11 | Delay between message base open/lock retries (in milliseconds)
first_msg | number | 3.10 | First message number - READ ONLY
last_msg | number | 3.10 | Last message number - READ ONLY
total_msgs | number | 3.10 | Total number of messages - READ ONLY
max_crcs | number | 3.10 | Maximum number of message CRCs to store (for dupe checking) - READ ONLY
max_msgs | number | 3.10 | Maximum number of messages before expiration - READ ONLY
max_age | number | 3.10 | Maximum age (in days) of messages to store - READ ONLY
attributes | number | 3.10 | Message base attributes - READ ONLY
subnum | number | 3.10 | Sub-board number (0-based, 65535 for e-mail) - READ ONLY
is_open | boolean | 3.10 | true if the message base has been opened successfully - READ ONLY

## MsgBase.cfg object
Configuration parameters for this message area (sub-boards only) - READ ONLY - introduced in v3.10

`MsgBase.cfg` properties
Name | Type | Description
--- | --- | ---
index | undefined | Index into sub_list array (or -1 if not in array)
grp_index | undefined | Group's index into grp_list array
number | number | Unique (zero-based) number for this sub-board
grp_number | number | Group number
grp_name | string | Group name
code | string | Sub-board internal code
name | string | Sub-board name
description | string | Sub-board description
qwk_name | string | QWK conference name
area_tag | string | Area tag for FidoNet-style echoes, a.k.a. EchoTag
newsgroup | string | Newsgroup name (as configured or dynamically generated)
ars | string | Sub-board access requirements
read_ars | string | Sub-board reading requirements
post_ars | string | Sub-board posting requirements
operator_ars | string | Sub-board operator requirements
moderated_ars | string | Sub-board moderated-user requirements (if non-blank)
data_dir | string | Sub-board data storage location
fidonet_addr | string | FidoNet node address
fidonet_origin | string | FidoNet origin line
qwknet_tagline | string | QWK Network tagline
settings | number | Toggle options (bit-flags) - see `SUB_*` in `sbbsdefs.js` for details
ptridx | number | Index into message scan configuration/pointer file
qwk_conf | number | QWK conference number
max_crcs | number | Configured maximum number of message CRCs to store (for dupe checking)
max_msgs | number | Configured maximum number of messages before purging
max_age | number | Configured maximum age (in days) of messages before expiration
print_mode | number | Additional print mode flags to use when printing messages - see `P_*` in `sbbsdefs.js` for details
print_mode_neg | number | Print mode flags to negate when printing messages - see `P_*` in `sbbsdefs.js` for details

## MsgBase class object

## MsgBase.IndexPrototype object
Prototype for all index objects. Can be used to extend these objects. - introduced in v3.17

## MsgBase.HeaderPrototype object
Prototype for all header objects. Can be used to extend these objects. - introduced in v3.17

## FileBase class
Class used for accessing file databases - introduced in v3.19

To create a new FileBase object: `var filebase = new FileBase(string code_or_path, [bool is_path=false])`
where code_or_path is a file directory internal code, or ...
when is_path is `true`, the string parameter specifies the path to a file base (not an internal code) - new behavior in v3.21.

`FileBase` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
open | boolean | `FileBase.open()` | 3.19 | Open file base
close | boolean | `FileBase.close()` | 3.19 | Close file base (if open)
get | object | `FileBase.get(string filename or object file-meta-object [,number detail=FileBase.DETAIL.NORM])` | 3.19 | Get a file metadata object or `null` on failure. The file-meta-object may contain the following properties (depending on detail value):
`name` | Filename (required)
`vpath` | Virtual path to file READ ONLY
`desc` | Description (summary, 58 chars or less)
`extdesc` | Extended description (multi-line description, e.g. DIZ)
`author` | File author name (e.g. from SAUCE record)
`author_org` | File author organization (group, e.g. from SAUCE record)
`from` | Uploader's user name (e.g. for awarding credits)
`from_ip_addr` | Uploader's IP address (if available, for security tracking)
`from_host_name` | Uploader's host name (if available, for security tracking)
`from_protocol` | TCP/IP protocol used by uploader (if available, for security tracking)
`from_port` | TCP/UDP port number used by uploader (if available, for security tracking)
`to_list` | Comma-separated list of recipient user numbers (for user-to-user transfers)
`tags` | Space-separated list of tags
`anon` | `true` if the file was uploaded anonymously
`size` | File size, in bytes, at the time of upload
`cost` | File credit value (0=free)
`time` | File modification date/time (in time_t format)
`added` | Date/time file was uploaded/imported (in time_t format)
`last_downloaded` | Date/time file was last downloaded (in time_t format) or 0=never
`times_downloaded` | Total number of times file has been downloaded
`crc16` | 16-bit CRC of file contents
`crc32` | 32-bit CRC of file contents
`md5` | 128-bit MD5 digest of file contents (hexadecimal)
`sha1` | 160-bit SHA-1 digest of file contents (hexadecimal)
`auxdata` | File auxiliary information (JSON)
get_list | array | `FileBase.get_list([string filespec] [,number detail=FileBase.DETAIL.NORM] [,number since-time=0] [,bool sort=true [,number order]])` | 3.19 | Get a list (array) of file metadata objects, the default sort order is the sysop-configured order or `FileBase.SORT.NAME_AI`
get_name | string | `FileBase.get_name(path/filename)` | 3.19 | Return index-formatted (e.g. shortened) version of filename without path (file base does not have to be open)
get_names | array | `FileBase.get_names([string filespec] [,number since-time=0] [,bool sort=true [,number order]])` | 3.19 | Get a list of index-formatted (e.g. shortened) filenames (strings) from file base index, the default sort order is the sysop-configured order or `FileBase.SORT.NAME_AI`
get_path | string | `FileBase.get_path(string filename or object file-meta-object)` | 3.19 | Get the full path to the local file
get_size | number | `FileBase.get_size(string filename or object file-meta-object)` | 3.19 | Get the size of the local file, in bytes, or -1 if it does not exist
get_time | number | `FileBase.get_time(string filename or object file-meta-object)` | 3.19 | Get the modification date/time stamp of the local file
add | boolean | `FileBase.add(object file-meta-object [,bool use_diz=true-if-no-extdesc] [,object client=none])` | 3.19 | Add a file to the file base, returning `true` on success or `false` upon failure. Pass `use_diz` parameter as `true` or `false` to force or prevent the extraction/import of description file (e.g. FILE_ID.DIZ) within archive (e.g. ZIP) file.
remove | boolean | `FileBase.remove(filename [,bool delete=false])` | 3.19 | Remove an existing file from the file base and optionally delete file, may throw exception on errors (e.g. file remove failure)
update | boolean | `FileBase.update(filename, object file-meta-object [,bool use_diz_always=false] [,bool readd_always=false])` | 3.19 | Update metadata and/or rename an existing file in the file base, may throw exception on errors (e.g. file rename failure)
renew | boolean | `FileBase.renew(filename)` | 3.19 | Remove and re-add (as new) an existing file in the file base
hash | object | `FileBase.hash(string filename_or_fullpath)` | 3.19 | Calculate hashes of a file's contents (file base does not have to be open)
dump | array | `FileBase.dump(filename)` | 3.19 | Dump file header fields to an array of strings for diagnostic uses
format_name | string | `FileBase.format_name(path/filename [,number size=12] [,bool pad=false])` | 3.19 | Return formatted (e.g. shortened) version of filename without path (file base does not have to be open) for display (also available as a class method)

`FileBase` properties
Name | Type | Ver | Description
--- | --- | --- | ---
error | string | 3.19 | Last occurred file base error description - READ ONLY
status | number | 3.19 | Return value of last SMB Library function call - READ ONLY
file | string | 3.19 | Base path and filename of file base - READ ONLY
retry_time | number | 3.19 | File base open/lock retry timeout (in seconds)
retry_delay | number | 3.19 | Delay between file base open/lock retries (in milliseconds)
first_file | number | 3.19 | First file number - READ ONLY
last_file | number | 3.19 | Last file number - READ ONLY
last_file_time | number | 3.19 | Time-stamp of last file - READ ONLY
files | number | 3.19 | Total number of files - READ ONLY
update_time | number | 3.19 | Time-stamp of file base index (only writable when file base is closed)
max_files | number | 3.19 | Maximum number of files before expiration - READ ONLY
max_age | number | 3.19 | Maximum age (in days) of files to store - READ ONLY
attributes | number | 3.19 | File base attributes - READ ONLY
dirnum | number | 3.19 | Directory number (0-based, -1 if invalid) - READ ONLY
is_open | boolean | 3.19 | true if the file base has been opened successfully - READ ONLY

## FileBase class object

## FileBase.DETAIL object
Detail level numeric constants (in increasing verbosity)

`FileBase.DETAIL` properties
Name | Type | Description
--- | --- | ---
MIN | number | Include indexed-filenames only
NORM | number | Normal level of file detail (e.g. full filenames, minimal metadata)
EXTENDED | number | Normal level of file detail plus extended descriptions
AUXDATA | number | Normal level of file detail plus extended descriptions and auxiliary data (JSON format)
MAX | number | Maximum file detail, include undefined/null property values

## FileBase.SORT object
Sort order numeric constants

`FileBase.SORT` properties
Name | Type | Description
--- | --- | ---
NATURAL | number | Natural/index order (no sorting)
NAME_AI | number | Filename ascending, case insensitive sort order
NAME_DI | number | Filename descending, case insensitive sort order
NAME_AS | number | Filename ascending, case sensitive sort order
NAME_DS | number | Filename descending, case sensitive sort order
DATE_A | number | Import date/time ascending sort order
DATE_D | number | Import date/time descending sort order
SIZE_A | number | File size in bytes, ascending sort order
SIZE_D | number | File size in bytes, descending sort order

## File class
Class used for opening, creating, reading, or writing files on the local file system

Special features include:

1. Exclusive-access files (default) or shared files
   1. optional record-locking
   2. buffered or non-buffered I/O
2. Support for binary files
   1. native or network byte order (endian)
   2. automatic Unix-to-Unix (UUE), yEncode (yEnc) or Base64 encoding/decoding
3. Support for ASCII text files
   1. supports line-based I/O
      1. entire file may be read or written as an array of strings
      2. individual lines may be read or written one line at a time
   2. supports fixed-length records
      1. optional end-of-text (etx) character for automatic record padding/termination
      2. Synchronet `.dat` files use an etx value of 3 (Ctrl-C)
   3. supports `.ini` formatted configuration files
4. Dynamically-calculated industry standard checksums (e.g. CRC-16, CRC-32, MD5)

- introduced in v3.10

To create a new File object: `var f = new File(filename)`

`File` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
open | boolean | `File.open([string mode="w+"] [,bool shareable=false] [,number buffer_length])` | 3.10 | Open file, shareable defaults to false, buffer_length defaults to 2048 bytes, mode (default: `'w+'`) specifies the type of access requested for the file, as follows: `r` open for reading; if the file does not exist or cannot be found, the open call fails `w` open an empty file for writing; if the given file exists, its contents are destroyed `a` open for writing at the end of the file (appending); creates the file first if it doesn't exist `r+` open for both reading and writing (the file must exist) `w+` open an empty file for both reading and writing; if the given file exists, its contents are destroyed `a+` open for reading and appending `b` open in binary (untranslated) mode; translations involving carriage-return and linefeed characters are suppressed (e.g. `r+b`) `x` open a non-shareable file (that must not already exist) for exclusive access Note: When using the `iniSet` methods to modify a `.ini` file, the file must be opened for both reading and writing. Note: To open an existing or create a new file for both reading and writing (e.g. updating an `.ini` file) use the exists property like so: `file.open(file.exists ? 'r+':'w+');` Note: When shareable is `false`, uses the Synchronet `nopen()` function which will lock the file and perform automatic retries. The lock mode is as follows: `r` DENYWRITE - Allows other scripts to open the file for reading, but not for writing. `w` DENYALL - Does not allow other scripts to open the file when shareable is set to true `a` DENYALL - Does not allow other scripts to open the file when shareable is set to true `r+` DENYALL - Does not allow other scripts to open the file when shareable is set to true `w+` DENYALL - Does not allow other scripts to open the file when shareable is set to true `a+` DENYALL - Does not allow other scripts to open the file when shareable is set to true When shareable is `true` uses the standard C `fopen()` function, and will only attempt to open the file once and will perform no locking. The behavior when one script has a file opened with shareable set to a different value than is used with a new call is OS specific. On Windows, the second open will always fail and on *nix, the second open will always succeed.
popen | boolean | `File.popen([string mode="r+"] [,number buffer_length])` | 3.15 | Open pipe to command, buffer_length defaults to 2048 bytes, mode (default: `'r+'`) specifies the type of access requested for the file, as follows: `r` read the programs stdout; `w` write to the programs stdin `r+` open for both reading stdout and writing stdin (only functional on UNIX systems)
close | void | `File.close()` | 3.10 | Close file
remove | boolean | `File.remove()` | 3.10 | Remove the file from the disk
clear_error | boolean | `File.clear_error()` | 3.10 | Clears the current error value (AKA clearError)
flush | boolean | `File.flush()` | 3.10 | Flush/commit buffers to disk
rewind | boolean | `File.rewind()` | 3.11 | Repositions the file pointer (position) to the beginning of a file and clears error and end-of-file indicators
truncate | boolean | `File.truncate([length=0])` | 3.14 | Changes the file length (default: 0) and repositions the file pointer (position) to the new end-of-file
lock | boolean | `File.lock([offset=0] [,length=file_length-offset])` | 3.10 | Lock file record for exclusive access (file must be opened shareable)
unlock | boolean | `File.unlock([offset=0] [,length=file_length-offset])` | 3.10 | Unlock file record for exclusive access
read | string | `File.read([maxlen=file_length-file_position])` | 3.10 | Read a string from file (optionally unix-to-unix or base64 encoding in the process), maxlen defaults to the current length of the file minus the current file position
readln | string | `File.readln([maxlen=512])` | 3.10 | Read a line-feed terminated string, maxlen defaults to 512 characters. Returns null upon end of file.
readBin | number | `File.readBin([bytes=4 [,count=1]])` | 3.10 | Read one or more binary integers from the file, default number of bytes is 4 (32-bits). if count is not equal to 1, an array is returned (even if no integers were read)
readAll | array | `File.readAll([maxlen=512])` | 3.10 | Read all lines into an array of strings, maxlen defaults to 512 characters
raw_read | string | `File.raw_read([maxlen=1])` | 3.17 | Read a string from underlying file descriptor. Undefined results when mixed with any other read/write methods except raw_write, including indirect ones. maxlen defaults to one
raw_pollin | boolean | `File.raw_pollin([timeout])` | 3.17 | Waits up to timeout milliseconds (or forever if timeout is not specified) for data to be available via raw_read().
write | boolean | `File.write(text [,length=text_length])` | 3.10 | Write a string to the file (optionally unix-to-unix or base64 decoding in the process). If the specified length is longer than the text, the remaining length will be written as NUL bytes.
writeln | boolean | `File.writeln([text])` | 3.10 | Write a new-line terminated string (a line of text) to the file
writeBin | boolean | `File.writeBin(value(s) [,bytes=4])` | 3.10 | Write one or more binary integers to the file, default number of bytes is 4 (32-bits). If value is an array, writes the entire array to the file.
writeAll | boolean | `File.writeAll(array lines)` | 3.10 | Write an array of new-line terminated strings (lines of text) to the file
raw_write | boolean | `File.raw_write(text)` | 3.17 | Write a string to the underlying file descriptor. Undefined results when mixed with any other read/write methods except raw_read, including indirect ones.
printf | number | `File.printf(format [,args])` | 3.10 | Write a C-style formatted string to the file (ala the standard C `fprintf` function)
iniGetSections | array | `File.iniGetSections([prefix=none])` | 3.11 | Parse all section names from a `.ini` file (format = '`[section]`') and return the section names as an array of strings, optionally, only those section names that begin with the specified prefix
iniGetKeys | array | `File.iniGetKeys([section=root])` | 3.11 | Parse all key names from the specified section in a `.ini` file and return the key names as an array of strings. if section is undefined, returns key names from the root section
iniGetValue | undefined | `File.iniGetValue(section, key [,default=none])` | 3.11 | Parse a key from a `.ini` file and return its value (format = '`key = value`'). To parse a key from the root section, pass null for section. Returns the specified default value if the key or value is missing or invalid. Returns a bool, number, string, date, or an array of strings determined by the type of default value specified. Note: To insure that any/all values are returned as a string (e.g. numeric passwords are not returned as a number), pass an empty string ('') for the default value.
iniSetValue | boolean | `File.iniSetValue(section, key, [value=none])` | 3.12 | Set the specified key to the specified value in the specified section of a `.ini` file. to set a key in the root section, pass null for section.
iniGetObject | object | `File.iniGetObject([section=root] [,bool lowercase=false] [,bool blanks=false])` | 3.11 | Parse an entire section from a .ini file and return all of its keys (optionally lowercased) and values as properties of an object. If section is `null` or `undefined`, returns keys and values from the root section. If blanks is `true` then empty string (instead of `undefined`) values may included in the returned object. Returns null if the specified section does not exist in the file or the file has not been opened.
iniSetObject | boolean | `File.iniSetObject(section, object object)` | 3.12 | Write all the properties of the specified object as separate `key=value` pairs in the specified section of a `.ini` file. To write an object in the root section, pass null for section. Note: this method does not remove unreferenced keys from an existing section. If your intention is to replace an existing section, use the `iniRemoveSection` function first.
iniGetAllObjects | array | `File.iniGetAllObjects([string name_property] [,string prefix=none] [,bool lowercase=false] [,blanks=false])` | 3.11 | Parse all sections from a .ini file and return all (non-root) sections in an array of objects with each section's keys (optionally lowercased) as properties of each object. name_property is the name of the property to create to contain the section's name (optionally lowercased, default is `"name"`), the optional prefix has the same use as in the `iniGetSections` method. If a (String) prefix is specified, it is removed from each section's name. If blanks is `true` then empty string (instead of `undefined`) values may be included in the returned objects.
iniSetAllObjects | boolean | `File.iniSetAllObjects(object array [,name_property="name"])` | 3.12 | Write an array of objects to a .ini file, each object in its own section named after the object's name_property (default: `name`)
iniRemoveKey | boolean | `File.iniRemoveKey(section, key)` | 3.14 | Remove specified key from specified section in `.ini` file.
iniRemoveSection | boolean | `File.iniRemoveSection(section)` | 3.14 | Remove specified section from `.ini` file.
iniRemoveSections | boolean | `File.iniRemoveSections([prefix])` | 3.20 | Remove all sections from `.ini` file, optionally only sections with the specified section name prefix.
iniReadAll | array | `File.iniReadAll()` | 3.18c | Read entire `.ini` file into an array of strings (with `!include`ed files).

`File` properties
Name | Type | Ver | Description
--- | --- | --- | ---
name | string | 3.10 | Filename specified in constructor - READ ONLY
mode | string | 3.10 | Mode string specified in open call - READ ONLY
exists | boolean | 3.10 | true if the file is open or exists (case-insensitive) - READ ONLY
is_open | boolean | 3.10 | true if the file has been opened successfully - READ ONLY
eof | boolean | 3.10 | true if the current file position is at the end of file - READ ONLY
error | number | 3.10 | The last occurred error value (use clear_error to clear) - READ ONLY
descriptor | number | 3.10 | The open file descriptor (advanced use only) - READ ONLY
etx | number | 3.10 | End-of-text character (advanced use only), if non-zero used by read, readln, and write
debug | boolean | 3.10 | Set to true to enable debug log output
position | number | 3.10 | The current file position (offset in bytes), change value to seek within file
date | number | 3.11 | Last modified date/time (in time_t format)
length | number | 3.10 | The current length of the file (in bytes)
attributes | number | 3.10 | File type/mode flags (i.e. `struct stat.st_mode` value, compatible with `file_chmod()`)
network_byte_order | boolean | 3.11 | Set to true if binary data is to be written and read in Network Byte Order (big end first)
rot13 | boolean | 3.11 | Set to true to enable automatic ROT13 translation of text
uue | boolean | 3.11 | Set to true to enable automatic Unix-to-Unix encode and decode on `read` and `write` calls
yenc | boolean | 3.11 | Set to true to enable automatic yEnc encode and decode on `read` and `write` calls
base64 | boolean | 3.11 | Set to true to enable automatic Base64 encode and decode on `read` and `write` calls
crc16 | number | 3.11 | Calculated 16-bit CRC of file contents - READ ONLY
crc32 | number | 3.11 | Calculated 32-bit CRC of file contents - READ ONLY
chksum | number | 3.11 | Calculated 32-bit checksum of file contents - READ ONLY
md5_hex | undefined | 3.11 | Calculated 128-bit MD5 digest of file contents as hexadecimal string - READ ONLY
md5_base64 | undefined | 3.11 | Calculated 128-bit MD5 digest of file contents as base64-encoded string - READ ONLY
sha1_hex | undefined | 3.19 | Calculated 160-bit SHA1 digest of file contents as hexadecimal string - READ ONLY
sha1_base64 | undefined | 3.19 | Calculated 160-bit SHA1 digest of file contents as base64-encoded string - READ ONLY
ini_key_len | number | 3.17 | Ini style: minimum key length (for left-justified white-space padded keys)
ini_key_prefix | object | 3.17 | Ini style: key prefix (e.g. '\t', null = default prefix)
ini_section_separator | object | 3.17 | Ini style: section separator (e.g. '\n', null = default separator)
ini_value_separator | object | 3.17 | Ini style: value separator (e.g. ' = ', null = default separator)
ini_bit_separator | object | 3.17 | Ini style: bit separator (e.g. ' | ', null = default separator)
ini_literal_separator | object | 3.17 | Ini style: literal separator (null = default separator)

## Archive class
Class used for creating, reading, or extracting archive files on the local file system
Note: cannot be used to update (e.g. add/remove/replace files in) an existing archive. - introduced in v3.19

To create a new Archive object: `var a = new Archive(filename)`

`Archive` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
create | number | `Archive.create([string format] [,bool with_path=false] [,array file_list])` | 3.19 | Create an archive of the specified format (e.g. 'zip', '7z', 'tgz'). Returns the number of files archived. Will throw exception upon error.
read | string | `Archive.read(string path/filename)` | 3.19 | Read and return the contents of the specified archived text file.
extract | number | `Archive.extract(output_directory [,bool with_path=false] [,bool overwrite=true] [,number max_files=0] [,string file/pattern [...]] [,bool recurse=false])` | 3.19 | Extract files from an archive to specified output directory. Returns the number of files extracted. Will throw exception upon error.
list | array | `Archive.list([,bool hash=false] [,string file/pattern])` | 3.19 | Get list of archive contents as an array of objects, optionally filtered by a specified path/filename pattern. Archived object properties:
Name | Type | Description
--- | --- | ---
`type` | string | Item type: 'file', 'link', or 'directory'
`name` | string | Item path/name
`path` | string | Source path
`symlink` | string
`hardlink` | string
`size` | number | Item size in bytes
`time` | number | Modification date/time in time_t format
`mode` | number | Permissions/mode flags
`user` | string | Owner name
`group` | string | Owner group
`format` | string | Archive format
`compression` | string | Compression method
`fflags` | string
`crc16` | number | 16-bit CRC, when hash is true and `type` is 'file'
`crc32` | number | 32-bit CRC, when hash is true and `type` is 'file'
`md5` | string | Hexadecimal MD-5 sum, when hash is true and `type` is 'file'
`sha1` | string | Hexadecimal SHA-1 sum, when hash is true and `type` is 'file'
When the `hash` parameter is `true`, calculates and returns hash/digest values of files in stored archive.

`Archive` properties
Name | Type | Description
--- | --- | ---
type | string | Format/compression type of archive file - READ ONLY
name | string | Filename specified in constructor - READ ONLY

## Archive class object

`Archive` properties
Name | Type | Description
--- | --- | ---
supported_formats | object |

## Queue class
Class for bi-directional message queues. Used for inter-thread/module communications. - introduced in v3.12

To create a new (named) Queue object: `var q = new Queue(name)`

`Queue` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
poll | undefined | `Queue.poll([number timeout=0])` | 3.12 | Wait for any value to be written to the queue for up to timeout milliseconds (default: 0), returns `true` or the name (string) of the value waiting (if it has one), or `false` if no values are waiting
read | undefined | `Queue.read([string name] or [numbertimeout=0])` | 3.13 | Read a value from the queue, if name not specified, reads next value from the bottom of the queue (waiting up to timeout milliseconds)
peek | undefined | `Queue.peek([number timeout=0])` | 3.13 | Peek at the value at the bottom of the queue, wait up to timeout milliseconds for any value to be written (default: 0)
write | boolean | `Queue.write(value [,name=none])` | 3.12 | Write a value (optionally named) to the queue

`Queue` properties
Name | Type | Ver | Description
--- | --- | --- | ---
name | undefined | 3.12 | Name of the queue (if it has one)
data_waiting | boolean | 3.12 | `true` if data is waiting to be read from queue
read_level | number | 3.12 | Number of values in the read queue
write_level | number | 3.12 | Number of values in the write queue
owner | boolean | 3.16 | `true` if current thread is the owner/creator of the queue
orphan | boolean | 3.17c | `true` if the owner of the queue has detached from the queue

## Socket class
Class used for TCP/IP socket communications - introduced in v3.10

To create a new Socket object: `load('sockdefs.js'); var s = new Socket(type, protocol ,ipv6=false)`
where type = `SOCK_STREAM` for TCP (default) or `SOCK_DGRAM` for UDP
and protocol (optional) = the name of the protocol or service the socket is to be used for
To create a socket from an existing socket descriptor: `var s = new Socket(true, descriptor)`
where descriptor is the numerical value of an existing valid socket descriptor

`Socket` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
close | void | `Socket.close()` | 3.10 | Close (shutdown) the socket immediately
bind | boolean | `Socket.bind([port] [,ip_address])` | 3.11 | Bind socket to a TCP or UDP port (number or service name), optionally specifying a network interface (via ip_address)
connect | boolean | `Socket.connect(host, port [,timeout=10] [,callback])` | 3.11 | Connect to a remote port (number or service name) on the specified host (IP address or host name), default timeout value is 10 (seconds). Instead of a timeout, you can pass a callback which is called when the connection completes with the Socket object as the only parameter.
listen | boolean | `Socket.listen()` | 3.10 | Place socket in a state to listen for incoming connections (use before an accept)
accept | object | `Socket.accept()` | 3.10 | Accept an incoming connection, returns a new Socket object representing the new connection
send | number | `Socket.send(data)` | 3.10 | Send a string (AKA write). Returns the number of bytes sent or undefined if an error occured. Versions before 3.17 returned a bool true if all bytes were sent and false otherwise.
sendline | boolean | `Socket.sendline(data)` | 3.17 | Send a string (AKA write) with a carriage return line feed appended
sendto | boolean | `Socket.sendto(data, address, port)` | 3.10 | Send data to a specific host (IP address or host name) and port (number or service name), for UDP sockets
sendfile | boolean | `Socket.sendfile(path/filename)` | 3.10 | Send an entire file over the socket
sendBin | boolean | `Socket.sendBin(value [,bytes=4])` | 3.11 | Send a binary integer over the socket, default number of bytes is 4 (32-bits)
recv | string | `Socket.recv([maxlen=512, [timeout_sec=120]])` | 3.10 | Receive a string, default maxlen is 512 characters (AKA read)
peek | string | `Socket.peek([maxlen=512])` | 3.10 | Receive a string, default maxlen is 512 characters, leaves string in receive buffer (TLS sockets will never return more than one byte)
recvline | string | `Socket.recvline([maxlen=512] [,timeout=30])` | 3.10 | Receive a line-feed terminated string, default maxlen is 512 characters, default timeout is 30 seconds (AKA readline and readln)
recvfrom | object | `Socket.recvfrom([binary=false] [,maxlen=512 or int_size=4])` | 3.11 | Receive data (string or integer) from a socket (typically UDP) returns object with ip_address and port of sender along with data properties binary defaults to `false`, maxlen defaults to 512 chars, int_size defaults to 4 bytes (32-bits)
recvBin | number | `Socket.recvBin([bytes=4])` | 3.11 | Receive a binary integer from the socket, default number of bytes is 4 (32-bits)
getoption | number | `Socket.getoption(option)` | 3.10 | Get socket option value, option may be socket option name (see `sockopts` in `sockdefs.js`) or number
setoption | boolean | `Socket.setoption(option, value)` | 3.10 | Set socket option value, option may be socket option name (see `sockopts` in `sockdefs.js`) or number
ioctl | number | `Socket.ioctl(command [,argument=0])` | 3.10 | Send socket IOCTL (advanced)
poll | number | `Socket.poll([timeout=0] [,write=false])` | 3.10 | Poll socket for read or write ability (default is read), default timeout value is 0.0 seconds (immediate timeout) returns -1 on error, 0 if the timeout passes without the event triggering, and 1 if the socket is ready
on | number | `Socket.on(('read' | 'write'), callback)` | 3.19 | Execute callback whenever socket is readable/writable. Returns an id to be passed to `js.clearOn()`
once | number | `Socket.once(('read' | 'write'), callback)` | 3.19 | Execute callback next time socket is readable/writable Returns and id to be passed to `js.clearOnce()`
clearOn | number | `Socket.clearOn(('read' | 'write'), id)` | 3.19 | Remove callback installed by Socket.on()
clearOnce | number | `Socket.clearOnce(('read' | 'write'), id)` | 3.19 | Remove callback installed by Socket.once()

`Socket` properties
Name | Type | Ver | Description
--- | --- | --- | ---
error | number | 3.11 | Error status for the last socket operation that failed - READ ONLY
error_str | string | 3.18 | Error description for the last socket operation that failed - READ ONLY
is_connected | boolean | 3.10 | `true` if socket is in a connected state - READ ONLY
is_writeable | boolean | 3.11 | `true` if socket can accept written data - Setting to false will shutdown the write end of the socket.
is_writable | boolean | 3.12 | Alias for is_writeable
data_waiting | boolean | 3.10 | `true` if data is waiting to be read from socket - READ ONLY
nread | number | 3.10 | Number of bytes waiting to be read - TLS sockets will never return more than 1 - READ ONLY
debug | number | 3.10 | Enable debug logging
descriptor | number | 3.10 | Socket descriptor (advanced uses only)
nonblocking | boolean | 3.10 | Use non-blocking operation (default is `false`)
local_ip_address | string | 3.10 | Local IP address (string in dotted-decimal format)
local_port | number | 3.10 | Local TCP or UDP port number
remote_ip_address | string | 3.10 | Remote IP address (string in dotted-decimal format)
remote_port | number | 3.10 | Remote TCP or UDP port number
type | number | 3.10 | Socket type, `SOCK_STREAM` (TCP) or `SOCK_DGRAM` (UDP)
family | number | 3.18 | Socket protocol family, `PF_INET` (IPv4) or `PF_INET6` (IPv6)
network_byte_order | boolean | 3.11 | `true` if binary data is to be sent in Network Byte Order (big end first), default is `true`
ssl_session | boolean | 3.16 | Set to `true` to enable SSL as a client on the socket
ssl_server | boolean | 3.16 | Set to `true` to enable SSL as a server on the socket
tls_minver | number | 3.20 | Set to 100 to support TLS 1.0, 101 to support TLS 1.1 and 102 (default) for TLS 1.2, must be set before enabling TLS
tls_psk | undefined | 3.20c | Set to an object with id: key pairs for TLS PSK auth, must be set before enabling TLS
tls_psk_id | undefined | 3.20c | If TLS PSK is used, indicates which entry in tls_psk was used by the remote
tls_nameverify | boolean | 3.21b | Enables/Disables TLS server name verification, must be set before enabling TLS
tls_certverify | boolean | 3.21b | Enables/Disables TLS certificate verification, must be set before enabling TLS
tls_client_auth | boolean | 3.21b | Enables/Disables TLS client authentication, must be set before enabling TLS
tls_enhanced_certcheck | boolean | 3.21b | Enables/Disables Enhanced check of TLS certificates
option_list | object | N/A | Array of socket option names supported by the current platform

## Socket class object

`Socket` properties
Name | Type | Description
--- | --- | ---
AF_INET | number |
AF_INET6 | number |
IPPROTO_IP | number |
PF_INET | number |
PF_INET6 | number |
PF_UNSPEC | number |
SOCK_DGRAM | number |
SOCK_STREAM | number |

## ConnectedSocket class
Class used for outgoing TCP/IP socket communications - introduced in v3.17

To create a new ConnectedSocket object: `load('sockdefs.js'); var s = new ConnectedSocket(hostname, port, {domain:domain, proto:proto ,type:type, protocol:protocol, timeout:timeout, bindport:port, bindaddrs:bindaddrs})`
where domain (optional) = `PF_UNSPEC` (default) for IPv4 or IPv6, `PF_INET` for IPv4, or `PF_INET6` for IPv6
proto (optional) = `IPPROTO_IP` (default)
type (optional) = `SOCK_STREAM` for TCP (default) or `SOCK_DGRAM` for UDP
protocol (optional) = the name of the protocol or service the socket is to be used for
timeout (optional) = 10 (default) the number of seconds to wait for each connect() call to complete.
bindport (optional) = the name or number of the source port to bind to
bindaddrs (optional) = the name or number of the source addresses to bind to. The first of each IPv4 or IPv6 type is used for that family.

## ListeningSocket class
Class used for incoming TCP/IP socket communications - introduced in v3.17

To create a new ListeningSocket object: `load('sockdefs.js'); var s = new ListeningSocket(interface, port ,protocol, {domain:domain, type:type, proto:proto, retry_count:retry_count, retry_delay:retry_delay})`
where interface = A array or strings or a single string of hostnames or address optionally including a :port suffix
port = a port to use when the interface doesn't specify one
protocol = protocol name, used for socket options and logging.
domain (optional) = `PF_UNSPEC` (default) for IPv4 or IPv6, `AF_INET` for IPv4, or `AF_INET6` for IPv6
proto (optional) = `IPPROTO_IP` (default)
type (optional) = `SOCK_STREAM` for TCP (default) or `SOCK_DGRAM` for UDP
retry_count (optional) = `0` (default) number of times to retry binding
and retry_delay (optional) = `15` (default) seconds to wait before a retry

## MQTT class
Class used for MQTT communications - introduced in v3.20

To create a new MQTT object: `var mqtt = new MQTT([client_id])`

`MQTT` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
connect | boolean | `MQTT.connect([string broker_address] [,number broker_port] [,string username] [,string password])` | 3.20 | Connect to an MQTT broker, by default (i.e. no arguments provided), the broker configured in SCFG->Networks->MQTT
disconnect | void | `MQTT.disconnect()` | 3.20 | Close an open connection to the MQTT broker
publish | boolean | `MQTT.publish([bool retain=false,] [number qos,] topic, data)` | 3.20 | Publish a string to specified topic
subscribe | boolean | `MQTT.subscribe([number qos,] topic)` | 3.20 | Subscribe to specified topic at (optional) QOS level
read | string | `MQTT.read([number timeout=0] [,bool verbose=false])` | 3.20 | Read next message, optionally waiting for timeout milliseconds, returns an object instead of a string when verbose is `true`. Returns `false` when no message is available.

`MQTT` properties
Name | Type | Ver | Description
--- | --- | --- | ---
error | number | 3.20 | Result (error value) of last MQTT library function call - READ ONLY
error_str | string | 3.20 | Result description of last MQTT library function call - READ ONLY
library | string | 3.20 | MQTT library name and version - READ ONLY
broker_addr | string | 3.20 | IP address or hostname of MQTT broker to connect to, by default
broker_port | number | 3.20 | TCP port number of MQTT broker to connect to, by default
username | string | 3.20 | Username to use when authenticating with MQTT broker, by default
password | string | 3.20 | Password to use when authenticating with MQTT broker, by default
keepalive | number | 3.20 | Seconds of time to keep inactive connection alive
protocol_version | number | 3.20 | Protocol version number (3 = 3.1.0, 4 = 3.1.1, 5 = 5.0)
publish_qos | number | 3.20 | Quality Of Service (QOS) value to use when publishing, by default
subscribe_qos | number | 3.20 | Quality Of Service (QOS) value to use when subscribing, by default
tls_mode | number | 3.20 | TLS (encryption) mode
tls_ca_cert | string | 3.20 | TLS Certificate Authority (CA) certificate (file path)
tls_client_cert | string | 3.20 | TLS Client certificate (file path)
tls_private_key | string | 3.20 | Private key file
tls_key_password | string | 3.20 | Private key file password
tls_psk | string | 3.20 | TLS Pre-Shared-Key
tls_psk_identity | string | 3.20 | TLS PSK Identity
data_waiting | boolean | 3.20 | true if messages are waiting to be read
read_level | number | 3.20 | Number of messages waiting to be read

## COM class
Class used for serial port communications - introduced in v3.15b

To create a new COM object: `var c = new COM(device)`
where device = `COMx` (e.g. COM1) for Win32 or `/dev/ttyXY` for *nix (e.g. /dev/ttyu0)

`COM` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
close | void | `COM.close()` | 3.15 | Close the port immediately
open | boolean | `COM.open()` | 3.15 | Connect to a COM port
send | boolean | `COM.send(data)` | 3.15 | Send a string (AKA write)
sendfile | boolean | `COM.sendfile(path/filename)` | 3.15 | Send an entire file over the port
sendBin | boolean | `COM.sendBin(value [,bytes=4])` | 3.15 | Send a binary integer over the port, default number of bytes is 4 (32-bits)
recv | string | `COM.recv([maxlen=512 [,timeout=30]])` | 3.15 | Receive a string, default maxlen is 512 characters, default timeout is 30 seconds (AKA read)
recvline | string | `COM.recvline([maxlen=512] [,timeout=30.0])` | 3.15 | Receive a line-feed terminated string, default maxlen is 512 characters, default timeout is 30 seconds (AKA readline and readln)
recvBin | number | `COM.recvBin([bytes=4 [,timeout=30])` | 3.15 | Receive a binary integer from the port, default number of bytes is 4 (32-bits), default timeout is 30 seconds

`COM` properties
Name | Type | Ver | Description
--- | --- | --- | ---
error | number | 3.15 | Error status for the last COM operation that failed - READ ONLY
is_open | boolean | 3.15 | `true` if port is in a connected state - READ ONLY
debug | boolean | 3.15 | Enable debug logging
descriptor | number | 3.15 | COM handle (advanced uses only)
network_byte_order | boolean | 3.15 | `true` if binary data is to be sent in Network Byte Order (big end first), default is `true`
baud_rate | number | 3.15 | COM port Baud rate
device | string | 3.15 | Device name
dtr | boolean | 3.15 | Data Terminal Ready
cts | boolean | 3.15 | Clear To Send
dsr | boolean | 3.15 | Data Set Ready
ring | boolean | 3.15 | Ring Indicator
dcd | boolean | 3.15 | Data Carrier Detect

## conio object
Console Input/Output Object (DOS conio library functionality for jsexec) - introduced in v3.15

`conio` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
init | boolean | `conio.init([mode])` | 3.15 | Initialize the conio library and creates a window if needed. Mode is a string with one of the following values:
"AUTO" (default) | Automatically select the "best" output mode.
"ANSI" | Use ANSI escape sequences directly
"STDIO" | Use stdio, worst, but most compatible mode.
"X" | Use X11 output *nix only)
"CONIO" | Use the native conio library (Windows only)
"CONIO_FULLSCREEN" | Use the native conio library and request full-screen (full-screen does not work on all versions of Windows) (Windows only)
"CURSES" | Use the curses terminal library (*nix only)
"CURSES_IBM" | Use the curses terminal library and write extended ASCII characters directly as-is, assuming the terminal is using CP437. (*nix only)
"CURSES_ASCII" | Use the curses terminal library and write US-ASCII characters only. (*nix only)
"SDL" | Use the SDL library for output.
"SDL_FULLSCREEN" | Use the SDL library for output (fullscreen).
suspend | void | `conio.suspend()` | 3.15 | Suspend conio in CONIO or CURSES modes so the terminal can be used for other things.
clreol | void | `conio.clreol()` | 3.15 | Clear to end of line
clrscr | void | `conio.clrscr()` | 3.15 | Clear the screen
wscroll | void | `conio.wscroll()` | 3.15 | Scroll the currently defined window up by one line.
delline | void | `conio.delline()` | 3.15 | Delete the current line and moves lines below up by one line.
insline | void | `conio.insline()` | 3.15 | Insert a new blank line on the current line and scrolls lines below down to make room.
normvideo | void | `conio.normvideo()` | 3.15 | Set the current attribute to "normal" (light grey on black)
getch | number | `conio.getch()` | 3.15 | Wait for and returns a character from the user. Extended keys are returned as two characters.
getche | number | `conio.getche()` | 3.15 | Wait for a character from the user, then echos it. Extended keys can not be returned and are lost.
beep | void | `conio.beep()` | 3.15 | Beep.
getfont | number | `conio.getfont(fnum)` | 3.15 | Return the current font ID or -1 if fonts aren't supported.
hidemouse | number | `conio.hidemouse()` | 3.15 | Hide the mouse cursor. Returns -1 if it cannot be hidden.
showmouse | number | `conio.showmouse()` | 3.15 | Show the mouse cursor. Returns -1 if it cannot be shown.
setcursortype | void | `conio.setcursortype(type)` | 3.15 | Set the cursor type. Legal values:
0 | No cursor
1 | Solid cursor (fills whole cell)
2 | Normal cursor
gotoxy | void | `conio.gotoxy(x, y)` | 3.15 | Move the cursor to the given x/y position.
putch | number | `conio.putch(charcode)` | 3.15 | Put the character with the specified ASCII character on the screen and advances the cursor. Returns the character code passed in.
ungetch | number | `conio.ungetch(charcode)` | 3.15 | Push the specified charcode into the input buffer. The next getch() call will get this character.
loadfont | void | `conio.loadfont(filename)` | 3.15 | Load the filename as the current font. Returns -1 on failure.
settitle | void | `conio.settitle(title)` | 3.15 | Set the window title if possible.
setname | void | `conio.setname(name)` | 3.15 | Set the application name. In some modes, this overwrites the window title.
cputs | void | `conio.cputs(string)` | 3.15 | Output string to the console.
setfont | number | `conio.setfont(font [, force, fnum])` | 3.15 | Set a current font to the specified font. If force is set, will change video modes if the current one callot use the specified font. fnum selects which current font to change:
0 | Default font
1 | Main font
2 | First alternate font
3 | Second alternate font
4 | Third alternate font
Returns -1 on failure
getpass | string | `conio.getpass(prompt)` | 3.15 | Prompt for a password, and waits for it to be entered. Characters are not echoed to the screen.
window | void | `conio.window(start_x, start_y, end_x, end_y)` | 3.15 | Set the current window.
cgets | void | `conio.cgets(max_len)` | 3.15 | Input a string, echoing as it's typed, with the specified max_len (up to 255).
movetext | void | `conio.movetext(start_x, start_y, end_x, end_y, dest_x, dest_y)` | 3.15 | Copy the specified screen contents to dest_x/dest_y.
puttext | boolean | `conio.puttext(start_x, start_y, end_x, end_y, bytes)` | 3.15 | Put the contents of the bytes array onto the screen filling the specified rectange. The array is a sequences if integers between 0 and 255 specifying first the ascii character code, then the attribute for that character.
gettext | array | `conio.gettext(start_x, start_y, end_x, end_y)` | 3.15 | Return an array containing the characters and attributes for the specified rectangle.

`conio` properties
Name | Type | Ver | Description
--- | --- | --- | ---
wscroll | boolean | 3.15 | Allows windows to scroll
directvideo | boolean | 3.15 | Enables direct video writes (does nothing)
hold_update | boolean | 3.15 | Do not update the screen when characters are printed
puttext_can_move | boolean | 3.15 | Calling puttext() (and some other things implemented using it) can move the cursor position
mode | number | 3.15 | The current video mode - READ ONLY
mouse | boolean | 3.15 | Mouse enabled (1) or disabled (0) - READ ONLY
ESCDELAY | number | 3.15 | Delay in MS after getting an escape character before assuming it is not part of a sequence. For curses and ANSI modes
textattr | number | 3.15 | Current text attribute
kbhit | boolean | 3.15 | True if a keystroke is pending - READ ONLY
wherex | number | 3.15 | Current x position on the screen
wherey | number | 3.15 | Current y position on the screen
textmode | number | 3.15 | Current text mode
winleft | number | 3.15 | Left column of current window - READ ONLY
wintop | number | 3.15 | Top row of current window - READ ONLY
winright | number | 3.15 | Right column of current window - READ ONLY
winbottom | number | 3.15 | Bottom row of current window - READ ONLY
screenwidth | number | 3.15 | Width of the screen - READ ONLY
screenheight | number | 3.15 | Height of the screen - READ ONLY
normattr | number | 3.15 | Attribute considered "normal" - READ ONLY
textbackground | number | 3.15 | Background colour
textcolor | number | 3.15 | Foreground colour
clipboard | string | 3.15 | Text in the clipboard
lowvideo | boolean | 3.15 | Current attribute is low intensity
highvideo | boolean | 3.15 | Current attribute is high intensity

## CryptContext class
Class used for encryption/decryption - introduced in v3.16b

To create a new CryptContext object: `var c = new CryptContext(algorithm)`
where algorithm is a property of CryptContext.ALGO

`CryptContext` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
generate_key | void | `CryptContext.generate_key()` | 3.16 | Generate a new key for the context.
set_key | void | `CryptContext.set_key(key_str)` | 3.16 | Set the key for the context directly.
derive_key | void | `CryptContext.derive_key(keying_data)` | 3.16 | Derive the key from the keying data using keying_algo, keying_iterations, and keying_salt.
encrypt | string | `CryptContext.encrypt(plaintext)` | 3.16 | Encrypt the string and return as a new string.
decrypt | string | `CryptContext.decrypt(ciphertext)` | 3.16 | Decrypt the string and return as a new string.
create_signature | string | `CryptContext.create_signature(sigContext)` | 3.16 | Create a signature signed with the sigContext CryptContext object.

`CryptContext` properties
Name | Type | Ver | Description
--- | --- | --- | ---
algo | number | 3.16 | Algorithm constant (CryptContext.ALGO.XXX)
blocksize | number | 3.16 | Cipher block size in bytes
hashvalue | undefined | 3.16 | Output of hasing algorithms (ie: MD5, SHA1, etc)
iv | undefined | 3.16 | Cipher IV
ivsize | number | 3.16 | Cipher IV size in bytes
keying_algo | undefined | 3.16 | The keying algorithm used to derive the key
keying_iterations | number | 3.16 | The number of iterates used to derive the key
keying_salt | undefined | 3.16 | The salt value used to derive an encryption key from a key (Length must be between 8 and 64)
keysize | number | 3.16 | Key size in bytes
label | undefined | 3.16 | Key label
mode | number | 3.16 | Mode constant (CryptContext.MODE.XXX)
algo_name | string | 3.16 | Algorithm name
mode_name | string | 3.16 | Mode name

## CryptContext class object

## CryptContext.ALGO object
Associative array of crypto algorithm constants - introduced in v3.18

`CryptContext.ALGO` properties
Name | Type | Description
--- | --- | ---
None | number | No encryption
DES | number | DES is a 64-bit block cipher with a 56-bit key. Note that this algorithm is no longer considered secure and should not be used. It is present in cryptlib only for compatibility with legacy applications. Although cryptlib uses 64-bit DES keys, only 56 bits of the key are actually used. The least significant bit in each byte is used as a parity bit (cryptlib will set the correct parity values for you, so you don't have to worry about this). You can treat the algorithm as having a 64-bit key, but bear in mind that only the high 7 bits of each byte are actually used as keying material. Loading a key will return a CRYPT_ERROR_PARAM3 error if the key is a weak key. cryptExportKey will export the correct parity-adjusted version of the key.
3DES | number | Triple DES is a 64-bit block cipher with a 112/168-bit key. Although cryptlib uses 128, or 192-bit DES keys (depending on whether two- or three-key triple DES is being used), only 112 or 168 bits of the key are actually used. The least significant bit in each byte is used as a parity bit (cryptlib will set the correct parity values for you, so you don't have to worry about this). You can treat the algorithm as having a 128 or 192-bit key, but bear in mind that only the high 7 bits of each byte are actually used as keying material. Loading a key will return a CRYPT_ERROR_PARAM3 error if the key is a weak key. cryptExportKey will export the correct parity-adjusted version of the key.
IDEA | number | IDEA is a 64-bit block cipher with a 128-bit key. IDEA was formerly covered by patents, but these have now all expired.
CAST | number | CAST-128 is a 64-bit block cipher with a 128-bit key
RC2 | number | RC2 (disabled by default, used for PKCS #12)
RC4 | number | RC4 is an 8-bit stream cipher with a key of up to 1024 bits. Some weaknesses have been found in this algorithm, and it's proven to be extremely difficult to employ in a safe manner. For this reason it should not be used any more except for legacy application support, and is disabled by default. The term "RC4" is trademarked in the US. It may be necessary to refer to it as "an algorithm compatible with RC4" in products that use RC4 and are distributed in the US. Common practice is to refer to it as ArcFour.
AES | number | AES is a 128-bit block cipher with a 128-bit key.
ChaCha20 | number | ChaCha20 is a 512-bit state stream cipher with a 128 or 256-bit key size.
DH | number | Diffie-Hellman is a key-agreement algorithm with a key size of up to 4096 bits. Diffie-Hellman was formerly covered by a patent in the US, this has now expired.
RSA | number | RSA is a public-key encryption/digital signature algorithm with a key size of up to 4096 bits. RSA was formerly covered by a patent in the US, this has now expired.
DSA | number | DSA is a digital signature algorithm with a key size of up to 1024 bits and has the cryptlib algorithm identifier CRYPT_ALGO_DSA. DSA is covered by US patent 5,231,668, with the patent held by the US government. This patent has been made available royalty-free to all users world-wide. The US Department of Commerce is not aware of any other patents that would be infringed by the DSA. US patent 4,995,082, "Method for identifying subscribers and for generating and verifying electronic signatures in a data exchange system" ("the Schnorr patent") relates to the DSA algorithm but only applies to a very restricted set of smart-card based applications and does not affect the DSA implementation in cryptlib.
ELGAMAL | number | Elgamal is a public-key encryption/digital signature algorithm with a key size of up to 4096 bits. Elgamal was formerly covered (indirectly) by a patent in the US, this has now expired.
ECDSA | number | ECDSA is a digital signature algorithm with a key size of up to 521 bits.
ECDH | number | ECDH is a key-agreement algorithm with a key size of up to 521 bits.
EDDSA | number | EDDSA is a digital signature scheme using a variant of Schnorr signature based on twisted Edwards curves.
X25519 | number | X25519 is a digital signature scheme using one of the fastest curves in ECC, and is not covered by any known patents.
MD5 | number | MD5 (only used for TLS 1.0/1.1)
SHA1 | number | SHA1 is a message digest/hash algorithm with a digest/hash size of 160 bits. This algorithm has poor long-term security prospects and should be deprecated in favour of SHA-2.
SHA2 | number | SHA2/SHA256 is a message digest/hash algorithm with a digest/hash size of 256 bits.
SHAng | number | Future SHA-nextgen standard
HMAC-SHA1 | number | HMAC-SHA1 is a MAC algorithm with a key size of up to 1024 bits.
HMAC-SHA2 | number | HMAC-SHA2 is a MAC algorithm with a key size of up to 1024 bits.
HMAC-SHAng | number | HMAC-future-SHA-nextgen
Poly1305 | number | Poly1305 is a universal hash family designed for use in cryptography.

## CryptContext.MODE object
Associative array of crypto mode constants - introduced in v3.18

`CryptContext.MODE` properties
Name | Type | Description
--- | --- | ---
None | number | No encryption mode
ECB | number | ECB
CBC | number | CBC
CFB | number | CFB
GCM | number | GCM

## CryptKeyset class
Class used for storing CryptContext keys - introduced in v3.16b

To create a new CryptKeyset object: `var c = new CryptKeyset(filename [ opts = CryptKeyset.KEYOPT.NONE ])`
where filename is the name of the file to create, and opts is a value from CryptKeyset.KEYOPT

`CryptKeyset` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
add_private_key | void | `CryptKeyset.add_private_key(CryptContext, password)` | 3.16 | Add a private key to the keyset, encrypting it with <password>.
add_public_key | void | `CryptKeyset.add_public_key(CryptCert)` | 3.16 | Add a public key (certificate) to the keyset.
close | void | `CryptKeyset.close()` | 3.16 | Close the keyset.
delete_key | void | `CryptKeyset.delete_key(label)` | 3.16 | Delete the key with <label> from the keyset.
get_private_key | object | `CryptKeyset.get_private_key(label, password)` | 3.16 | Return a CryptContext from the private key with encrypted with <password>.
get_public_key | object | `CryptKeyset.get_public_key(label)` | 3.16 | Return a CryptCert from the public key with <label>.

## CryptKeyset class object

## CryptKeyset.KEYOPT object
Associative array of keyset option constants - introduced in v3.18

`CryptKeyset.KEYOPT` properties
Name | Type | Description
--- | --- | ---
NONE | number | No special access options (this option implies read/write access).
READONLY | number | Read-only keyset access. This option is automatically enabled by cryptlib for keyset types that have read-only restrictions enforced by the nature of the keyset, the operating system, or user access rights. Unless you specifically require write access to the keyset, you should use this option since it allows cryptlib to optimise its buffering and access strategies for the keyset.
CREATE | number | Create a new keyset. This option is only valid for writeable keyset types, which includes keysets implemented as databases and cryptlib key files.

## CryptCert class
Class used for Certificates - introduced in v3.16b

To create a new CryptCert object: var c = new CryptCert(type | cert)
where type is a value from CryptCert.TYPE and cert is a DER encoded certificate string

`CryptCert` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
add_extension | void | `CryptCert.add_extension(oid, critical, extension)` | 3.16 | Adds a DER encoded certificate extension.
check | boolean | `CryptCert.check()` | 3.16 | Checks the certificate for validity.
destroy | void | `CryptCert.destroy()` | 3.16 | Destroys the certificate.
export_cert | string | `CryptCert.export_cert(format)` | 3.16 | Exports the certificate in the format chosen from CryptCert.FORMAT.
get_attribute | void | `CryptCert.get_attribute(attr)` | 3.16 | Gets the specified attribute as an integer
get_attribute_string | void | `CryptCert.get_attribute_string(attr)` | 3.16 | Gets the specified attribute as a string
get_attribute_time | void | `CryptCert.get_attribute_time(attr)` | 3.16 | Gets the specified attribute as a time
set_attribute | void | `CryptCert.set_attribute(attr, value)` | 3.16 | Sets the specified attribute to the specified value
set_attribute_string | void | `CryptCert.set_attribute_string(attr, value)` | 3.16 | Sets the specified attribute to the specified value
set_attribute_time | void | `CryptCert.set_attribute_time(attr, value)` | 3.16 | Sets the specified attribute to the specified value
sign | void | `CryptCert.sign(key)` | 3.16 | Signs the certificate with the specified CryptContext

`CryptCert` properties
Name | Type | Ver | Description
--- | --- | --- | ---
selfsigned | number | 3.16 |
immutable | number | 3.16 |
xyzzy | number | 3.16 |
certtype | number | 3.16 |
fingerprint_sha1 | undefined | 3.16 |
fingerprint_sha2 | undefined | 3.16 |
fingerprint_shang | undefined | 3.16 |
current_certificate | undefined | 3.16 |
trusted_usage | undefined | 3.16 |
trusted_implicit | undefined | 3.16 |
signaturelevel | undefined | 3.16 |
version | number | 3.16 |
serialnumber | undefined | 3.16 |
subjectpublickeyinfo | undefined | 3.16 |
certificate | undefined | 3.16 |
cacertificate | undefined | 3.16 |
issuername | undefined | 3.16 |
validfrom | undefined | 3.16 |
validto | undefined | 3.16 |
subjectname | undefined | 3.16 |
issueruniqueid | undefined | 3.16 |
subjectuniqueid | undefined | 3.16 |
certrequest | undefined | 3.16 |
thisupdate | undefined | 3.16 |
nextupdate | undefined | 3.16 |
revocationdate | undefined | 3.16 |
revocationstatus | undefined | 3.16 |
certstatus | undefined | 3.16 |
dn | undefined | 3.16 |
pkiuser_id | undefined | 3.16 |
pkiuser_issuepassword | undefined | 3.16 |
pkiuser_revpassword | undefined | 3.16 |
pkiuser_ra | undefined | 3.16 |
countryname | undefined | 3.16 |
stateorprovincename | undefined | 3.16 |
localityname | undefined | 3.16 |
organizationname | undefined | 3.16 |
organizationalunitname | undefined | 3.16 |
commonname | undefined | 3.16 |
othername_typeid | undefined | 3.16 |
othername_value | undefined | 3.16 |
rfc822name | undefined | 3.16 |
dnsname | undefined | 3.16 |
directoryname | undefined | 3.16 |
edipartyname_nameassigner | undefined | 3.16 |
edipartyname_partyname | undefined | 3.16 |
uniformresourceidentifier | undefined | 3.16 |
ipaddress | undefined | 3.16 |
registeredid | undefined | 3.16 |
challengepassword | undefined | 3.16 |
crlextreason | undefined | 3.16 |
keyfeatures | undefined | 3.16 |
authorityinfoaccess | undefined | 3.16 |
authorityinfo_rtcs | undefined | 3.16 |
authorityinfo_ocsp | undefined | 3.16 |
authorityinfo_caissuers | undefined | 3.16 |
authorityinfo_certstore | undefined | 3.16 |
authorityinfo_crls | undefined | 3.16 |
biometricinfo | undefined | 3.16 |
biometricinfo_type | undefined | 3.16 |
biometricinfo_hashalgo | undefined | 3.16 |
biometricinfo_hash | undefined | 3.16 |
biometricinfo_url | undefined | 3.16 |
qcstatement | undefined | 3.16 |
qcstatement_semantics | undefined | 3.16 |
qcstatement_registrationauthority | undefined | 3.16 |
ipaddressblocks | undefined | 3.16 |
ipaddressblocks_addressfamily | undefined | 3.16 |
ipaddressblocks_prefix | undefined | 3.16 |
ipaddressblocks_min | undefined | 3.16 |
ipaddressblocks_max | undefined | 3.16 |
autonomoussysids | undefined | 3.16 |
autonomoussysids_asnum_id | undefined | 3.16 |
autonomoussysids_asnum_min | undefined | 3.16 |
autonomoussysids_asnum_max | undefined | 3.16 |
ocsp_nonce | undefined | 3.16 |
ocsp_response | undefined | 3.16 |
ocsp_response_ocsp | undefined | 3.16 |
ocsp_nocheck | undefined | 3.16 |
ocsp_archivecutoff | undefined | 3.16 |
subjectinfoaccess | undefined | 3.16 |
subjectinfo_timestamping | undefined | 3.16 |
subjectinfo_carepository | undefined | 3.16 |
subjectinfo_signedobjectrepository | undefined | 3.16 |
subjectinfo_rpkimanifest | undefined | 3.16 |
subjectinfo_signedobject | undefined | 3.16 |
sigg_dateofcertgen | undefined | 3.16 |
sigg_procuration | undefined | 3.16 |
sigg_procure_country | undefined | 3.16 |
sigg_procure_typeofsubstitution | undefined | 3.16 |
sigg_procure_signingfor | undefined | 3.16 |
sigg_admissions | undefined | 3.16 |
sigg_admissions_authority | undefined | 3.16 |
sigg_admissions_namingauthid | undefined | 3.16 |
sigg_admissions_namingauthurl | undefined | 3.16 |
sigg_admissions_namingauthtext | undefined | 3.16 |
sigg_admissions_professionitem | undefined | 3.16 |
sigg_admissions_professionoid | undefined | 3.16 |
sigg_admissions_registrationnumber | undefined | 3.16 |
sigg_monetarylimit | undefined | 3.16 |
sigg_monetary_currency | undefined | 3.16 |
sigg_monetary_amount | undefined | 3.16 |
sigg_monetary_exponent | undefined | 3.16 |
sigg_declarationofmajority | undefined | 3.16 |
sigg_declarationofmajority_country | undefined | 3.16 |
sigg_restriction | undefined | 3.16 |
sigg_certhash | undefined | 3.16 |
sigg_additionalinformation | undefined | 3.16 |
strongextranet | undefined | 3.16 |
strongextranet_zone | undefined | 3.16 |
strongextranet_id | undefined | 3.16 |
subjectdirectoryattributes | undefined | 3.16 |
subjectdir_type | undefined | 3.16 |
subjectdir_values | undefined | 3.16 |
subjectkeyidentifier | undefined | 3.16 |
keyusage | undefined | 3.16 |
privatekeyusageperiod | undefined | 3.16 |
privatekey_notbefore | undefined | 3.16 |
privatekey_notafter | undefined | 3.16 |
subjectaltname | undefined | 3.16 |
issueraltname | undefined | 3.16 |
basicconstraints | undefined | 3.16 |
ca | undefined | 3.16 |
pathlenconstraint | undefined | 3.16 |
crlnumber | undefined | 3.16 |
crlreason | undefined | 3.16 |
holdinstructioncode | undefined | 3.16 |
invaliditydate | undefined | 3.16 |
deltacrlindicator | undefined | 3.16 |
issuingdistributionpoint | undefined | 3.16 |
issuingdist_fullname | undefined | 3.16 |
issuingdist_usercertsonly | undefined | 3.16 |
issuingdist_cacertsonly | undefined | 3.16 |
issuingdist_somereasonsonly | undefined | 3.16 |
issuingdist_indirectcrl | undefined | 3.16 |
certificateissuer | undefined | 3.16 |
nameconstraints | undefined | 3.16 |
permittedsubtrees | undefined | 3.16 |
excludedsubtrees | undefined | 3.16 |
crldistributionpoint | undefined | 3.16 |
crldist_fullname | undefined | 3.16 |
crldist_reasons | undefined | 3.16 |
crldist_crlissuer | undefined | 3.16 |
certificatepolicies | undefined | 3.16 |
certpolicyid | undefined | 3.16 |
certpolicy_cpsuri | undefined | 3.16 |
certpolicy_organization | undefined | 3.16 |
certpolicy_noticenumbers | undefined | 3.16 |
certpolicy_explicittext | undefined | 3.16 |
policymappings | undefined | 3.16 |
issuerdomainpolicy | undefined | 3.16 |
subjectdomainpolicy | undefined | 3.16 |
authoritykeyidentifier | undefined | 3.16 |
authority_keyidentifier | undefined | 3.16 |
authority_certissuer | undefined | 3.16 |
authority_certserialnumber | undefined | 3.16 |
policyconstraints | undefined | 3.16 |
requireexplicitpolicy | undefined | 3.16 |
inhibitpolicymapping | undefined | 3.16 |
extkeyusage | undefined | 3.16 |
extkey_ms_individualcodesigning | undefined | 3.16 |
extkey_ms_commercialcodesigning | undefined | 3.16 |
extkey_ms_certtrustlistsigning | undefined | 3.16 |
extkey_ms_timestampsigning | undefined | 3.16 |
extkey_ms_servergatedcrypto | undefined | 3.16 |
extkey_ms_encryptedfilesystem | undefined | 3.16 |
extkey_serverauth | undefined | 3.16 |
extkey_clientauth | undefined | 3.16 |
extkey_codesigning | undefined | 3.16 |
extkey_emailprotection | undefined | 3.16 |
extkey_ipsecendsystem | undefined | 3.16 |
extkey_ipsectunnel | undefined | 3.16 |
extkey_ipsecuser | undefined | 3.16 |
extkey_timestamping | undefined | 3.16 |
extkey_ocspsigning | undefined | 3.16 |
extkey_directoryservice | undefined | 3.16 |
extkey_anykeyusage | undefined | 3.16 |
extkey_ns_servergatedcrypto | undefined | 3.16 |
extkey_vs_servergatedcrypto_ca | undefined | 3.16 |
crlstreamidentifier | undefined | 3.16 |
freshestcrl | undefined | 3.16 |
freshestcrl_fullname | undefined | 3.16 |
freshestcrl_reasons | undefined | 3.16 |
freshestcrl_crlissuer | undefined | 3.16 |
orderedlist | undefined | 3.16 |
baseupdatetime | undefined | 3.16 |
deltainfo | undefined | 3.16 |
deltainfo_location | undefined | 3.16 |
deltainfo_nextdelta | undefined | 3.16 |
inhibitanypolicy | undefined | 3.16 |
toberevoked | undefined | 3.16 |
toberevoked_certissuer | undefined | 3.16 |
toberevoked_reasoncode | undefined | 3.16 |
toberevoked_revocationtime | undefined | 3.16 |
toberevoked_certserialnumber | undefined | 3.16 |
revokedgroups | undefined | 3.16 |
revokedgroups_certissuer | undefined | 3.16 |
revokedgroups_reasoncode | undefined | 3.16 |
revokedgroups_invaliditydate | undefined | 3.16 |
revokedgroups_startingnumber | undefined | 3.16 |
revokedgroups_endingnumber | undefined | 3.16 |
expiredcertsoncrl | undefined | 3.16 |
aaissuingdistributionpoint | undefined | 3.16 |
aaissuingdist_fullname | undefined | 3.16 |
aaissuingdist_somereasonsonly | undefined | 3.16 |
aaissuingdist_indirectcrl | undefined | 3.16 |
aaissuingdist_userattrcerts | undefined | 3.16 |
aaissuingdist_aacerts | undefined | 3.16 |
aaissuingdist_soacerts | undefined | 3.16 |
ns_certtype | undefined | 3.16 |
ns_baseurl | undefined | 3.16 |
ns_revocationurl | undefined | 3.16 |
ns_carevocationurl | undefined | 3.16 |
ns_certrenewalurl | undefined | 3.16 |
ns_capolicyurl | undefined | 3.16 |
ns_sslservername | undefined | 3.16 |
ns_comment | undefined | 3.16 |
set_hashedrootkey | undefined | 3.16 |
set_rootkeythumbprint | undefined | 3.16 |
set_certificatetype | undefined | 3.16 |
set_merchantdata | undefined | 3.16 |
set_merid | undefined | 3.16 |
set_meracquirerbin | undefined | 3.16 |
set_merchantlanguage | undefined | 3.16 |
set_merchantname | undefined | 3.16 |
set_merchantcity | undefined | 3.16 |
set_merchantstateprovince | undefined | 3.16 |
set_merchantpostalcode | undefined | 3.16 |
set_merchantcountryname | undefined | 3.16 |
set_mercountry | undefined | 3.16 |
set_merauthflag | undefined | 3.16 |
set_certcardrequired | undefined | 3.16 |
set_tunneling | undefined | 3.16 |
set_tunnelingflag | undefined | 3.16 |
set_tunnelingalgid | undefined | 3.16 |
cms_contenttype | undefined | 3.16 |
cms_messagedigest | undefined | 3.16 |
cms_signingtime | undefined | 3.16 |
cms_countersignature | undefined | 3.16 |
cms_signingdescription | undefined | 3.16 |
cms_smimecapabilities | undefined | 3.16 |
cms_smimecap_3des | undefined | 3.16 |
cms_smimecap_aes | undefined | 3.16 |
cms_smimecap_cast128 | undefined | 3.16 |
cms_smimecap_shang | undefined | 3.16 |
cms_smimecap_sha2 | undefined | 3.16 |
cms_smimecap_sha1 | undefined | 3.16 |
cms_smimecap_hmac_shang | undefined | 3.16 |
cms_smimecap_hmac_sha2 | undefined | 3.16 |
cms_smimecap_hmac_sha1 | undefined | 3.16 |
cms_smimecap_authenc256 | undefined | 3.16 |
cms_smimecap_authenc128 | undefined | 3.16 |
cms_smimecap_rsa_shang | undefined | 3.16 |
cms_smimecap_rsa_sha2 | undefined | 3.16 |
cms_smimecap_rsa_sha1 | undefined | 3.16 |
cms_smimecap_dsa_sha1 | undefined | 3.16 |
cms_smimecap_ecdsa_shang | undefined | 3.16 |
cms_smimecap_ecdsa_sha2 | undefined | 3.16 |
cms_smimecap_ecdsa_sha1 | undefined | 3.16 |
cms_smimecap_prefersigneddata | undefined | 3.16 |
cms_smimecap_cannotdecryptany | undefined | 3.16 |
cms_smimecap_preferbinaryinside | undefined | 3.16 |
cms_receiptrequest | undefined | 3.16 |
cms_receipt_contentidentifier | undefined | 3.16 |
cms_receipt_from | undefined | 3.16 |
cms_receipt_to | undefined | 3.16 |
cms_securitylabel | undefined | 3.16 |
cms_seclabel_policy | undefined | 3.16 |
cms_seclabel_classification | undefined | 3.16 |
cms_seclabel_privacymark | undefined | 3.16 |
cms_seclabel_cattype | undefined | 3.16 |
cms_seclabel_catvalue | undefined | 3.16 |
cms_mlexpansionhistory | undefined | 3.16 |
cms_mlexp_entityidentifier | undefined | 3.16 |
cms_mlexp_time | undefined | 3.16 |
cms_mlexp_none | undefined | 3.16 |
cms_mlexp_insteadof | undefined | 3.16 |
cms_mlexp_inadditionto | undefined | 3.16 |
cms_contenthints | undefined | 3.16 |
cms_contenthint_description | undefined | 3.16 |
cms_contenthint_type | undefined | 3.16 |
cms_equivalentlabel | undefined | 3.16 |
cms_eqvlabel_policy | undefined | 3.16 |
cms_eqvlabel_classification | undefined | 3.16 |
cms_eqvlabel_privacymark | undefined | 3.16 |
cms_eqvlabel_cattype | undefined | 3.16 |
cms_eqvlabel_catvalue | undefined | 3.16 |
cms_signingcertificate | undefined | 3.16 |
cms_signingcert_esscertid | undefined | 3.16 |
cms_signingcert_policies | undefined | 3.16 |
cms_signingcertificatev2 | undefined | 3.16 |
cms_signingcertv2_esscertidv2 | undefined | 3.16 |
cms_signingcertv2_policies | undefined | 3.16 |
cms_signaturepolicyid | undefined | 3.16 |
cms_sigpolicyid | undefined | 3.16 |
cms_sigpolicyhash | undefined | 3.16 |
cms_sigpolicy_cpsuri | undefined | 3.16 |
cms_sigpolicy_organization | undefined | 3.16 |
cms_sigpolicy_noticenumbers | undefined | 3.16 |
cms_sigpolicy_explicittext | undefined | 3.16 |
cms_sigtypeidentifier | undefined | 3.16 |
cms_sigtypeid_originatorsig | undefined | 3.16 |
cms_sigtypeid_domainsig | undefined | 3.16 |
cms_sigtypeid_additionalattributes | undefined | 3.16 |
cms_sigtypeid_reviewsig | undefined | 3.16 |
cms_nonce | undefined | 3.16 |
scep_messagetype | undefined | 3.16 |
scep_pkistatus | undefined | 3.16 |
scep_failinfo | undefined | 3.16 |
scep_sendernonce | undefined | 3.16 |
scep_recipientnonce | undefined | 3.16 |
scep_transactionid | undefined | 3.16 |
cms_spcagencyinfo | undefined | 3.16 |
cms_spcagencyurl | undefined | 3.16 |
cms_spcstatementtype | undefined | 3.16 |
cms_spcstmt_individualcodesigning | undefined | 3.16 |
cms_spcstmt_commercialcodesigning | undefined | 3.16 |
cms_spcopusinfo | undefined | 3.16 |
cms_spcopusinfo_name | undefined | 3.16 |
cms_spcopusinfo_url | undefined | 3.16 |

## CryptCert class object

## CryptCert.CURSOR object
Associative array of cursor constants - introduced in v3.18

`CryptCert.CURSOR` properties
Name | Type | Description
--- | --- | ---
FIRST | number | Move the cursor to the first group or attribute.
PREVIOUS | number | Move the cursor to the last group or attribute.
NEXT | number | Move the cursor to the next group or attribute.
LAST | number | Move the cursor to the previous group or attribute.
CURRENT_GROUP | number |
CURRENT | number |
CURRENT_INSTANCE | number |
CURRENT_CERTIFICATE | number |

## CryptCert.TYPE object
Associative array of certificate type constants - introduced in v3.18

`CryptCert.TYPE` properties
Name | Type | Description
--- | --- | ---
NONE | number | No certificate type
CERTIFICATE | number | Certificate.
ATTRIBUTE_CERT | number | Attribute certificate.
CERTCHAIN | number | PKCS #7 certificate chain.
CERTREQUEST | number | PKCS #10 certification request.
REQUEST_CERT | number | CRMF certificate request
REQUEST_REVOCATION | number | CRMF certificate revocation request
CRL | number | CRL
CMS_ATTRIBUTES | number | PKCS #7/CMS attributes.
RTCS_REQUEST | number | RTCS request
RTCS_RESPONSE | number | RTCS response
OCSP_REQUEST | number | OCSP request
OCSP_RESPONSE | number | OCSP response
PKIUSER | number | PKI user information.

## CryptCert.FORMAT object
Associative array of certificate format constants - introduced in v3.18

`CryptCert.FORMAT` properties
Name | Type | Description
--- | --- | ---
NONE | number | No certificate format
CERTIFICATE | number | A certification request, certificate, or CRL in binary data format. The certificate object is encoded according to the ASN.1 distinguished encoding rules. This is the normal certificate encoding format.
CERTCHAIN | number | A certificate encoded as a PKCS #7 certificate chain.
TEXT_CERTIFICATE | number | As CERTIFICATE but with base64 armouring of the binary data.
TEXT_CERTCHAIN | number | As CERTCHAIN but with base64 armouring of the binary data.
XML_CERTIFICATE | number | XML wrapped cert
XML_CERTCHAIN | number | XML wrapped certchain

## CryptCert.ATTR object
Associative array of certificate attribute constants - introduced in v3.18

`CryptCert.ATTR` properties
Name | Type | Description
--- | --- | ---
SELFSIGNED | number |
IMMUTABLE | number |
XYZZY | number |
CERTTYPE | number |
FINGERPRINT_SHA1 | number |
FINGERPRINT_SHA2 | number |
FINGERPRINT_SHAng | number |
CURRENT_CERTIFICATE | number |
TRUSTED_USAGE | number |
TRUSTED_IMPLICIT | number |
SIGNATURELEVEL | number |
VERSION | number |
SERIALNUMBER | number |
SUBJECTPUBLICKEYINFO | number |
CERTIFICATE | number |
CACERTIFICATE | number |
ISSUERNAME | number |
VALIDFROM | number |
VALIDTO | number |
SUBJECTNAME | number |
ISSUERUNIQUEID | number |
SUBJECTUNIQUEID | number |
CERTREQUEST | number |
THISUPDATE | number |
NEXTUPDATE | number |
REVOCATIONDATE | number |
REVOCATIONSTATUS | number |
CERTSTATUS | number |
DN | number |
PKIUSER_ID | number |
PKIUSER_ISSUEPASSWORD | number |
PKIUSER_REVPASSWORD | number |
PKIUSER_RA | number |
COUNTRYNAME | number |
STATEORPROVINCENAME | number |
LOCALITYNAME | number |
ORGANIZATIONNAME | number |
ORGANIZATIONALUNITNAME | number |
COMMONNAME | number |
OTHERNAME_TYPEID | number |
OTHERNAME_VALUE | number |
RFC822NAME | number |
DNSNAME | number |
DIRECTORYNAME | number |
EDIPARTYNAME_NAMEASSIGNER | number |
EDIPARTYNAME_PARTYNAME | number |
UNIFORMRESOURCEIDENTIFIER | number |
IPADDRESS | number |
REGISTEREDID | number |
CHALLENGEPASSWORD | number |
CRLEXTREASON | number |
KEYFEATURES | number |
AUTHORITYINFOACCESS | number |
AUTHORITYINFO_RTCS | number |
AUTHORITYINFO_OCSP | number |
AUTHORITYINFO_CAISSUERS | number |
AUTHORITYINFO_CERTSTORE | number |
AUTHORITYINFO_CRLS | number |
BIOMETRICINFO | number |
BIOMETRICINFO_TYPE | number |
BIOMETRICINFO_HASHALGO | number |
BIOMETRICINFO_HASH | number |
BIOMETRICINFO_URL | number |
QCSTATEMENT | number |
QCSTATEMENT_SEMANTICS | number |
QCSTATEMENT_REGISTRATIONAUTHORITY | number |
IPADDRESSBLOCKS | number |
IPADDRESSBLOCKS_ADDRESSFAMILY | number |
IPADDRESSBLOCKS_PREFIX | number |
IPADDRESSBLOCKS_MIN | number |
IPADDRESSBLOCKS_MAX | number |
AUTONOMOUSSYSIDS | number |
AUTONOMOUSSYSIDS_ASNUM_ID | number |
AUTONOMOUSSYSIDS_ASNUM_MIN | number |
AUTONOMOUSSYSIDS_ASNUM_MAX | number |
OCSP_NONCE | number |
OCSP_RESPONSE | number |
OCSP_RESPONSE_OCSP | number |
OCSP_NOCHECK | number |
OCSP_ARCHIVECUTOFF | number |
SUBJECTINFOACCESS | number |
SUBJECTINFO_TIMESTAMPING | number |
SUBJECTINFO_CAREPOSITORY | number |
SUBJECTINFO_SIGNEDOBJECTREPOSITORY | number |
SUBJECTINFO_RPKIMANIFEST | number |
SUBJECTINFO_SIGNEDOBJECT | number |
SIGG_DATEOFCERTGEN | number |
SIGG_PROCURATION | number |
SIGG_PROCURE_COUNTRY | number |
SIGG_PROCURE_TYPEOFSUBSTITUTION | number |
SIGG_PROCURE_SIGNINGFOR | number |
SIGG_ADMISSIONS | number |
SIGG_ADMISSIONS_AUTHORITY | number |
SIGG_ADMISSIONS_NAMINGAUTHID | number |
SIGG_ADMISSIONS_NAMINGAUTHURL | number |
SIGG_ADMISSIONS_NAMINGAUTHTEXT | number |
SIGG_ADMISSIONS_PROFESSIONITEM | number |
SIGG_ADMISSIONS_PROFESSIONOID | number |
SIGG_ADMISSIONS_REGISTRATIONNUMBER | number |
SIGG_MONETARYLIMIT | number |
SIGG_MONETARY_CURRENCY | number |
SIGG_MONETARY_AMOUNT | number |
SIGG_MONETARY_EXPONENT | number |
SIGG_DECLARATIONOFMAJORITY | number |
SIGG_DECLARATIONOFMAJORITY_COUNTRY | number |
SIGG_RESTRICTION | number |
SIGG_CERTHASH | number |
SIGG_ADDITIONALINFORMATION | number |
STRONGEXTRANET | number |
STRONGEXTRANET_ZONE | number |
STRONGEXTRANET_ID | number |
SUBJECTDIRECTORYATTRIBUTES | number |
SUBJECTDIR_TYPE | number |
SUBJECTDIR_VALUES | number |
SUBJECTKEYIDENTIFIER | number |
KEYUSAGE | number |
PRIVATEKEYUSAGEPERIOD | number |
PRIVATEKEY_NOTBEFORE | number |
PRIVATEKEY_NOTAFTER | number |
SUBJECTALTNAME | number |
ISSUERALTNAME | number |
BASICCONSTRAINTS | number |
CA | number |
PATHLENCONSTRAINT | number |
CRLNUMBER | number |
CRLREASON | number |
HOLDINSTRUCTIONCODE | number |
INVALIDITYDATE | number |
DELTACRLINDICATOR | number |
ISSUINGDISTRIBUTIONPOINT | number |
ISSUINGDIST_FULLNAME | number |
ISSUINGDIST_USERCERTSONLY | number |
ISSUINGDIST_CACERTSONLY | number |
ISSUINGDIST_SOMEREASONSONLY | number |
ISSUINGDIST_INDIRECTCRL | number |
CERTIFICATEISSUER | number |
NAMECONSTRAINTS | number |
PERMITTEDSUBTREES | number |
EXCLUDEDSUBTREES | number |
CRLDISTRIBUTIONPOINT | number |
CRLDIST_FULLNAME | number |
CRLDIST_REASONS | number |
CRLDIST_CRLISSUER | number |
CERTIFICATEPOLICIES | number |
CERTPOLICYID | number |
CERTPOLICY_CPSURI | number |
CERTPOLICY_ORGANIZATION | number |
CERTPOLICY_NOTICENUMBERS | number |
CERTPOLICY_EXPLICITTEXT | number |
POLICYMAPPINGS | number |
ISSUERDOMAINPOLICY | number |
SUBJECTDOMAINPOLICY | number |
AUTHORITYKEYIDENTIFIER | number |
AUTHORITY_KEYIDENTIFIER | number |
AUTHORITY_CERTISSUER | number |
AUTHORITY_CERTSERIALNUMBER | number |
POLICYCONSTRAINTS | number |
REQUIREEXPLICITPOLICY | number |
INHIBITPOLICYMAPPING | number |
EXTKEYUSAGE | number |
EXTKEY_MS_INDIVIDUALCODESIGNING | number |
EXTKEY_MS_COMMERCIALCODESIGNING | number |
EXTKEY_MS_CERTTRUSTLISTSIGNING | number |
EXTKEY_MS_TIMESTAMPSIGNING | number |
EXTKEY_MS_SERVERGATEDCRYPTO | number |
EXTKEY_MS_ENCRYPTEDFILESYSTEM | number |
EXTKEY_SERVERAUTH | number |
EXTKEY_CLIENTAUTH | number |
EXTKEY_CODESIGNING | number |
EXTKEY_EMAILPROTECTION | number |
EXTKEY_IPSECENDSYSTEM | number |
EXTKEY_IPSECTUNNEL | number |
EXTKEY_IPSECUSER | number |
EXTKEY_TIMESTAMPING | number |
EXTKEY_OCSPSIGNING | number |
EXTKEY_DIRECTORYSERVICE | number |
EXTKEY_ANYKEYUSAGE | number |
EXTKEY_NS_SERVERGATEDCRYPTO | number |
EXTKEY_VS_SERVERGATEDCRYPTO_CA | number |
CRLSTREAMIDENTIFIER | number |
FRESHESTCRL | number |
FRESHESTCRL_FULLNAME | number |
FRESHESTCRL_REASONS | number |
FRESHESTCRL_CRLISSUER | number |
ORDEREDLIST | number |
BASEUPDATETIME | number |
DELTAINFO | number |
DELTAINFO_LOCATION | number |
DELTAINFO_NEXTDELTA | number |
INHIBITANYPOLICY | number |
TOBEREVOKED | number |
TOBEREVOKED_CERTISSUER | number |
TOBEREVOKED_REASONCODE | number |
TOBEREVOKED_REVOCATIONTIME | number |
TOBEREVOKED_CERTSERIALNUMBER | number |
REVOKEDGROUPS | number |
REVOKEDGROUPS_CERTISSUER | number |
REVOKEDGROUPS_REASONCODE | number |
REVOKEDGROUPS_INVALIDITYDATE | number |
REVOKEDGROUPS_STARTINGNUMBER | number |
REVOKEDGROUPS_ENDINGNUMBER | number |
EXPIREDCERTSONCRL | number |
AAISSUINGDISTRIBUTIONPOINT | number |
AAISSUINGDIST_FULLNAME | number |
AAISSUINGDIST_SOMEREASONSONLY | number |
AAISSUINGDIST_INDIRECTCRL | number |
AAISSUINGDIST_USERATTRCERTS | number |
AAISSUINGDIST_AACERTS | number |
AAISSUINGDIST_SOACERTS | number |
NS_CERTTYPE | number |
NS_BASEURL | number |
NS_REVOCATIONURL | number |
NS_CAREVOCATIONURL | number |
NS_CERTRENEWALURL | number |
NS_CAPOLICYURL | number |
NS_SSLSERVERNAME | number |
NS_COMMENT | number |
SET_HASHEDROOTKEY | number |
SET_ROOTKEYTHUMBPRINT | number |
SET_CERTIFICATETYPE | number |
SET_MERCHANTDATA | number |
SET_MERID | number |
SET_MERACQUIRERBIN | number |
SET_MERCHANTLANGUAGE | number |
SET_MERCHANTNAME | number |
SET_MERCHANTCITY | number |
SET_MERCHANTSTATEPROVINCE | number |
SET_MERCHANTPOSTALCODE | number |
SET_MERCHANTCOUNTRYNAME | number |
SET_MERCOUNTRY | number |
SET_MERAUTHFLAG | number |
SET_CERTCARDREQUIRED | number |
SET_TUNNELING | number |
SET_TUNNELINGFLAG | number |
SET_TUNNELINGALGID | number |
CMS_CONTENTTYPE | number |
CMS_MESSAGEDIGEST | number |
CMS_SIGNINGTIME | number |
CMS_COUNTERSIGNATURE | number |
CMS_SIGNINGDESCRIPTION | number |
CMS_SMIMECAPABILITIES | number |
CMS_SMIMECAP_3DES | number |
CMS_SMIMECAP_AES | number |
CMS_SMIMECAP_CAST128 | number |
CMS_SMIMECAP_SHAng | number |
CMS_SMIMECAP_SHA2 | number |
CMS_SMIMECAP_SHA1 | number |
CMS_SMIMECAP_HMAC_SHAng | number |
CMS_SMIMECAP_HMAC_SHA2 | number |
CMS_SMIMECAP_HMAC_SHA1 | number |
CMS_SMIMECAP_AUTHENC256 | number |
CMS_SMIMECAP_AUTHENC128 | number |
CMS_SMIMECAP_RSA_SHAng | number |
CMS_SMIMECAP_RSA_SHA2 | number |
CMS_SMIMECAP_RSA_SHA1 | number |
CMS_SMIMECAP_DSA_SHA1 | number |
CMS_SMIMECAP_ECDSA_SHAng | number |
CMS_SMIMECAP_ECDSA_SHA2 | number |
CMS_SMIMECAP_ECDSA_SHA1 | number |
CMS_SMIMECAP_PREFERSIGNEDDATA | number |
CMS_SMIMECAP_CANNOTDECRYPTANY | number |
CMS_SMIMECAP_PREFERBINARYINSIDE | number |
CMS_RECEIPTREQUEST | number |
CMS_RECEIPT_CONTENTIDENTIFIER | number |
CMS_RECEIPT_FROM | number |
CMS_RECEIPT_TO | number |
CMS_SECURITYLABEL | number |
CMS_SECLABEL_POLICY | number |
CMS_SECLABEL_CLASSIFICATION | number |
CMS_SECLABEL_PRIVACYMARK | number |
CMS_SECLABEL_CATTYPE | number |
CMS_SECLABEL_CATVALUE | number |
CMS_MLEXPANSIONHISTORY | number |
CMS_MLEXP_ENTITYIDENTIFIER | number |
CMS_MLEXP_TIME | number |
CMS_MLEXP_NONE | number |
CMS_MLEXP_INSTEADOF | number |
CMS_MLEXP_INADDITIONTO | number |
CMS_CONTENTHINTS | number |
CMS_CONTENTHINT_DESCRIPTION | number |
CMS_CONTENTHINT_TYPE | number |
CMS_EQUIVALENTLABEL | number |
CMS_EQVLABEL_POLICY | number |
CMS_EQVLABEL_CLASSIFICATION | number |
CMS_EQVLABEL_PRIVACYMARK | number |
CMS_EQVLABEL_CATTYPE | number |
CMS_EQVLABEL_CATVALUE | number |
CMS_SIGNINGCERTIFICATE | number |
CMS_SIGNINGCERT_ESSCERTID | number |
CMS_SIGNINGCERT_POLICIES | number |
CMS_SIGNINGCERTIFICATEV2 | number |
CMS_SIGNINGCERTV2_ESSCERTIDV2 | number |
CMS_SIGNINGCERTV2_POLICIES | number |
CMS_SIGNATUREPOLICYID | number |
CMS_SIGPOLICYID | number |
CMS_SIGPOLICYHASH | number |
CMS_SIGPOLICY_CPSURI | number |
CMS_SIGPOLICY_ORGANIZATION | number |
CMS_SIGPOLICY_NOTICENUMBERS | number |
CMS_SIGPOLICY_EXPLICITTEXT | number |
CMS_SIGTYPEIDENTIFIER | number |
CMS_SIGTYPEID_ORIGINATORSIG | number |
CMS_SIGTYPEID_DOMAINSIG | number |
CMS_SIGTYPEID_ADDITIONALATTRIBUTES | number |
CMS_SIGTYPEID_REVIEWSIG | number |
CMS_NONCE | number |
SCEP_MESSAGETYPE | number |
SCEP_PKISTATUS | number |
SCEP_FAILINFO | number |
SCEP_SENDERNONCE | number |
SCEP_RECIPIENTNONCE | number |
SCEP_TRANSACTIONID | number |
CMS_SPCAGENCYINFO | number |
CMS_SPCAGENCYURL | number |
CMS_SPCSTATEMENTTYPE | number |
CMS_SPCSTMT_INDIVIDUALCODESIGNING | number |
CMS_SPCSTMT_COMMERCIALCODESIGNING | number |
CMS_SPCOPUSINFO | number |
CMS_SPCOPUSINFO_NAME | number |
CMS_SPCOPUSINFO_URL | number |

## uifc object
User InterFaCe object - Text User Interface (TUI) menu system for JSexec - introduced in v3.14

`uifc` methods
Name | Returns | Usage | Ver | Description
--- | --- | --- | --- | ---
init | boolean | `uifc.init(string title [,string interface_mode])` | 3.14 | Initialize the UIFC library with the specified application/script title (e.g. name and maybe version). `interface_mode` is a string representing the desired console mode, one of 'STDIO', 'AUTO', 'X', 'CURSES', 'ANSI', 'CONIO', or 'SDL' (see `conio.init()` for details). Return `true` upon successful UIFC library initialization, `false` upon error.
bail | void | `uifc.bail()` | 3.14 | Uninitialize the UIFC library
msg | void | `uifc.msg(string text)` | 3.14 | Print a short text message and wait for user acknowledgment
pop | void | `uifc.pop([string text])` | 3.14 | Pop-up (or down) a short text message. Pop-down by passing no text argument.
input | string | `uifc.input([number mode] [,number left] [,number top] [,string prompt] [,string default] [,number maxlen [,number k_mode]])` | 3.14 | Prompt for a string input. `mode` is an optional combination of `WIN_` mode flags from `uifcdefs.js`. `left` and `top` are optional window offsets to display the input dialog box. `prompt` is an optional text string to display as part of the string input dialog box. `default` is an optional original text string that the user can edit (requires the `K_EDIT k_mode` flag). `maxlen` is an optional maximum input string length (default is 40 characters). `k_mode` is an optional combination of `K_` mode flags from either `sbbsdefs.js` or `uifcdefs.js`. Return the new/edited string or `undefined` if editing was aborted (e.g. via ESC key press).
list | number | `uifc.list([number mode,] string title, array options [,uifc.list.CTX ctx])` | 3.14 | Select from a list of displayed options. `title` is the brief description of the list (menu) to be displayed in the list heading. `options` is an array of items (typically strings) that comprise the displayed list. The `CTX` (context) object can be created using `new uifc.list.CTX` and if the same object is passed in successive calls, allows `WIN_SAV` to work correctly. The context object has the following properties (numbers): `cur, bar, left, top, width` Return `-1` if list is aborted (e.g. via ESC key press), `false` upon error (e.g. no option array provided), or the 0-based numeric index of the option selected by the user. Other negative values may be returned in advanced modes/use-cases (e.g. copy/paste), see `MSK_` and related `WIN_` constants/comments in `uifcdefs.js` for details.
showhelp | void | `uifc.showhelp()` | 3.17 | Show the current help text
scrn | boolean | `uifc.scrn(string text)` | 3.18c | Fill the screen with the appropriate background attribute. string is the title for the application banner.
showbuf | void | `uifc.showbuf(number mode, string title, string helpbuf [,uifc.showbuf.CTX ctx])` | 3.18c | Show a scrollable text buffer - optionally parsing "help markup codes" The context object can be created using `new uifc.showbuf.CTX` and if the same object is passed, allows `WIN_SAV` to work correctly. The context object has the following properties (numbers): `cur, bar, left, top, width, height`
timedisplay | void | `uifc.timedisplay([bool force = false])` | 3.18c | Update time in upper right corner of screen with current time in ASCII/Unix format
bottomline | void | `uifc.bottomline(number mode)` | 3.18c | Display the bottom line using the `WIN_*` mode flags
getstrxy | string | `uifc.getstrxy(number left, number top, number width, number max, number mode [,string original][, uifc.getstrxy.CTX ctx])` | 3.18c | String input/exit box at a specified positionThe context object can be created using `new uifc.showbuf.CTX` and if the same object is passed, allows `WIN_SAV` to work correctly. The context object has the following properties: number `lastkey`

`uifc` properties
Name | Type | Ver | Description
--- | --- | --- | ---
initialized | boolean | 3.14 | UIFC library has been successfully initialized
mode | number | 3.14 | Current mode flags (see `uifcdefs.js`)
changes | boolean | 3.14 | A change has occurred in an input call. You are expected to set this to false before calling the input if you care about it.
save_num | number | 3.14 | Save buffer depth (advanced)
screen_length | number | 3.14 | Current screen length
screen_width | number | 3.14 | Current screen width
list_height | number | 3.14 | When `WIN_FIXEDHEIGHT` mode flag is set, specifies the height used by a list method
esc_delay | number | 3.14 | Delay before a single ESC char is parsed and assumed to not be an ANSI sequence (advanced)
help_text | string | 3.14 | Text that will be displayed when F1 or '?' keys are pressed
background_color | number | 3.14 | Background colour
frame_color | number | 3.14 | Frame colour
text_color | number | 3.14 | Text colour
inverse_color | number | 3.14 | Inverse colour
lightbar_color | number | 3.14 | Lightbar colour

Totals: 1474 properties, 505 methods