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