Export a Java library as an ES module in Graalvm/graaljs

48 views Asked by At

Is there some way to setup a Java object as a "module" for graaljs? Like, if I had a class like this

public class JavaLib {
    public static String foo() {
        return "foo";
    }

    public static String bar() {
        return "bar";
    }

}

is there some combination of Proxy objects or annotations that I could wire up such that my script could do this:

import {foo} form 'JavaLib'
let x = foo()
0

There are 0 answers