environment
- Description:
Environment namespace. This namespace handles utilities for determining the script environment and retrieving information about it. A word of caution: This namespace is considered an advanced API and might change without a new major version of the library.
- Source:
Members
(static) GRAALJS_VERSION :string
- Description:
GraalJS version
- Source:
GraalJS version
Type:
- string
(static) OPENHAB_JS_VERSION :string
- Description:
openHAB JavaScript library version
- Source:
openHAB JavaScript library version
Type:
- string
(static) OPENHAB_VERSION :string
- Description:
openHAB version
- Source:
openHAB version
Type:
- string
Methods
(static) isScriptFile() → {boolean}
- Description:
Returns whether the code is from a script file. This is determined by checking if the
javax.script.filename
global variable is defined. This is useful to distinguish between file-based scripts and UI-based scripts in openHAB.
- Source:
Returns:
true if the script is file-based, false otherwise
- Type
- boolean
(static) useProviderRegistries() → {boolean}
- Description:
Returns whether the registry implementations from the
@runtime/provider
module should be used instead of the default ones from the@runtime
module. Provider implementations should be used if the host openHAB version supports it and the script is running from a file-based script.
- Source:
Returns:
true if the provider registry implementations should be used, false otherwise
- Type
- boolean