javascript
EXPERIMENTAL
This component is experimental and therefore subject to change or removal outside of major version releases.
Executes a provided JavaScript code block or file for each message.
Introduced in version 1.0.0.
# Config fields, showing default values
label: ""
javascript:
code: "" # No default (optional)
file: "" # No default (optional)
global_folders: []
The execution engine behind this processor provides full ECMAScript 5.1 support (including regex and strict mode). Most of the ECMAScript 6 spec is implemented but this is a work in progress.
Imports via require
should work similarly to NodeJS, and access to the console is supported which will print via the Bento logger. More caveats can be found here.
This processor is implemented using the github.com/dop251/goja library.