BT.features
BT.features
Function
returns the current interpreter capability table.
Syntax
BT.features()
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| None | - | No | None | No parameters required. |
Return Value
| Type | Description |
|---|---|
| Object | Returns the interpreter capability object. See "Return Object Fields" below for fields. |
Return object field
| Field | Type | Must exist | Description |
|---|---|---|---|
| web | Bool | Yes | Whether to have built-in Web service capabilities. The current standard build is true. |
| desktop | Bool | Yes | Whether to enable desktop App capabilities. The CLI build is usually false and the bt_app desktop build is true. |
| ffi | Bool | Yes | Whether to build in the native dynamic library FFI. The official BT interpreter is true. |
| net | Bool | Yes | Whether to build in TCP, UDP, WebSocket, DNS and network interface related capabilities. |
| device | Bool | Yes | Whether to have built-in device communication capabilities. Currently contains serial serial port capabilities. |
| mysql | Bool | Yes | Whether the MySQL standard library is built-in. |
| reqwest | Bool | Yes | Whether to build in the HTTP client standard library. |
| crypto | Bool | Yes | Whether to have built-in encryption digest capabilities such as SHA, HMAC, and UUID. |
| fs | Bool | Yes | Whether to build the file system standard library. |
| process | Bool | Yes | Whether to build in child process and process environment related capabilities. |
| stats | Bool | Yes | Whether to build in BT.stats() runtime statistics capability. |
| bytes | Bool | Yes | Whether to build Bytes binary byte capability. |
| modbus | Bool | Yes | Whether to have built-in Modbus frame building, parsing and CRC auxiliary capabilities. |
Examples
features = BT.features() result = features.process // Output: true print result
Notes
- desktop will reflect whether the current binary actually enables desktop capabilities.
- ffi will reflect whether the current interpreter has built-in FFI; BT official interpreter has built-in FFI by default, and the special tailored version may be
false. - features returns the static capability table and does not perform runtime scanning.
- Field names are fixed with snake_case or lowercase words, and can be used with
BT.has(name)to determine individual abilities.