diff --git a/README.md b/README.md index d850002ab..eb9687c8e 100644 --- a/README.md +++ b/README.md @@ -523,7 +523,7 @@ All possible values can be found as const [here](https://gitlab.com/bboehmke/sun ### Javascript (read/write) -EVCC includes a bundled Javascript interpreter with Underscore.js library installed. The `js` plugin is able to execute Javascript code from the `script` tag. Useful for quick prototyping: +EVCC includes a bundled Javascript interpreter with Underscore.js library installed, which is directly accessible via `_.` e.g. `_.random(0,5)`. The `js` plugin is able to execute Javascript code from the `script` tag. Useful for quick prototyping: ```yaml source: js diff --git a/provider/javascript/init.go b/provider/javascript/init.go index acff54371..81ba1419a 100644 --- a/provider/javascript/init.go +++ b/provider/javascript/init.go @@ -3,6 +3,7 @@ package javascript import ( "github.com/evcc-io/evcc/util" "github.com/robertkrimen/otto" + _ "github.com/robertkrimen/otto/underscore" ) // Configure initializes JS VMs