JS: add underscore javascript lib (#1502)

This change is required to actually use the underscore javascript library, as documented here: https://github.com/robertkrimen/otto#underscore
This commit is contained in:
Andreas Linde 2021-09-07 20:04:47 +02:00 • committed by GitHub
parent bfc79bca64
commit b3a97bf461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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