[jsscripting] Update docs for code caching (#14166)

... and fix the table of contents.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This commit is contained in:
Florian Hotze 2023-01-05 23:04:07 +01:00 committed by GitHub
parent 1548f16f5e
commit b91fc94bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -15,6 +15,8 @@ to common openHAB functionality within rules including items, things, actions, l
- [Console](#console)
- [Timers](#timers)
- [Paths](#paths)
- [Deinitialization Hook](#deinitialization-hook)
- [`SCRIPT` Transformation](#script-transformation)
- [Standard Library](#standard-library)
- [Items](#items)
- [Things](#things)
@ -27,20 +29,22 @@ to common openHAB functionality within rules including items, things, actions, l
- [JSRule](#jsrule)
- [Rule Builder](#rule-builder)
- [Event Object](#event-object)
- [Initialization hook: scriptLoaded](#initialization-hook-scriptloaded)
- [Deinitialization hook: scriptUnloaded](#deinitialization-hook-scriptunloaded)
- [Advanced Scripting](#advanced-scripting)
- [Libraries](#libraries)
- [@runtime](#runtime)
## Configuration
This add-on includes by default the [openhab-js](https://github.com/openhab/openhab-js/) NPM library and exports its namespaces onto the global namespace.
This allows the use of `items`, `actions`, `cache` and other objects without the need to explicitly import using `require()`.
This allows the use of `items`, `actions`, `cache` and other objects without the need to explicitly import them using `require()`.
This functionality can be disabled for users who prefer to manage their own imports via the add-on configuration options.
By default, the injection of the included [openhab-js](https://github.com/openhab/openhab-js/) NPM library is cached to improve performance and reduce memory usage.
If you want to use a different version of openhab-js (installed to the `node_modules` folder) than the included one, you need to disable the usage of the included library.
![openHAB Rule Configuration](doc/settings.png)
<!-- Paste the copied docs from openhab-js under this comment. -->
<!-- Paste the copied docs from openhab-js under this comment. Do NOT forget the table of contents. -->
### UI Based Rules

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 63 KiB