You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/11/19 09:36:00 UTC
[jira] [Assigned] (CAMEL-18718) camel-javascript - Language based on graalvm sdk
[ https://issues.apache.org/jira/browse/CAMEL-18718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-18718:
-----------------------------------
Assignee: Claus Ibsen
> camel-javascript - Language based on graalvm sdk
> ------------------------------------------------
>
> Key: CAMEL-18718
> URL: https://issues.apache.org/jira/browse/CAMEL-18718
> Project: Camel
> Issue Type: New Feature
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.x
>
>
> 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
> {code}
> 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());
> }
> {code}
> If we can then make this as a language in Camel then end users can more easily use this together with Camel.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)