Javascript Plugin

Custom functionality can be added with Javascript to APIs with this plugin. Small scripts can be very powerful, e.g. you can:

As an alternative to the Javascript Plugin you can use the Groovy plugin.

See the examples/javascript folder for some samples.

Switch to the GraalVM Engine

The plugin comes with the Rhino Javascript engine. To use the newest Javascript features the engine can be replaced with the GraalVM Javascript engine.

Follow the steps below to add the GraalVM Javascript Engine to Membrane.

  1. Download from Maven Central the following files:
  2. graal-sdk-22.3.0.jar
  3. icu4j-71.1.jar
  4. js-22.3.0.jar
  5. regex-22.3.0.jar
  6. truffle-api-22.3.0.jar
  7. Copy the files into the MEMBRANE_HOME/lib folder.
  8. Stop and Start Membrane.

You can also use newer versions of the libraries.