Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Unknown
Description
Lets see if we can use graalvm-sdk or graalvm-js that can compile and execute javascript code (with npm modules imported)
A dirty prototype
public static void main(String[] args) throws IOException { String src = "import {faker} from '../js/node_modules/@faker-js/faker/dist/esm/index.mjs';" + "const randomName = faker.name.fullName();" + "console.log(randomName);"; Context cx = Context.newBuilder("js") .allowIO(true) .build(); cx.eval(Source.newBuilder("js", src, "test.mjs").build()); }
If we can then make this as a language in Camel then end users can more easily use this together with Camel.
Attachments
Issue Links
- links to