From: Florian Hotze Date: Thu, 5 Jan 2023 22:04:07 +0000 (+0100) Subject: [jsscripting] Update docs for code caching (#14166) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=b91fc94bdb4d999a04fc668c4bec2df35efee4b2;p=openhab-addons.git [jsscripting] Update docs for code caching (#14166) ... and fix the table of contents. Signed-off-by: Florian Hotze --- diff --git a/bundles/org.openhab.automation.jsscripting/README.md b/bundles/org.openhab.automation.jsscripting/README.md index 45f86299f5..af642e5210 100644 --- a/bundles/org.openhab.automation.jsscripting/README.md +++ b/bundles/org.openhab.automation.jsscripting/README.md @@ -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) - + ### UI Based Rules diff --git a/bundles/org.openhab.automation.jsscripting/doc/settings.png b/bundles/org.openhab.automation.jsscripting/doc/settings.png index a342844e4e..0e9a6eb536 100644 Binary files a/bundles/org.openhab.automation.jsscripting/doc/settings.png and b/bundles/org.openhab.automation.jsscripting/doc/settings.png differ