ES6 Promise support for Nashorn
This is a polyfill of the ES6 Promise using Java 8 CompletableFuture.
Getting Started
Setup
To add a dependency using Maven, use the following:
<dependency>
<groupId>net.arnx</groupId>
<artifactId>nashorn-promise</artifactId>
<version>0.1.3</version>
</dependency>
To add a dependency using Gradle:
dependencies {
compile 'net.arnx:nashorn-promise:0.1.3'
}
Usage
ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
engine.eval("load('classpath:net/arnx/nashorn/lib/promise.js')");
License
This project is licensed under the MIT License - see the LICENSE.md file for details