I mean, what I would like to do, is call JS code -...
# javascript
o
I mean, what I would like to do, is call JS code - which would be executed in node - and get results from it into the kotlin app (which will be running on JVM). Is that possible?
g
There is a few options, simplest one is just run node script as system process using ProcessBuilder or Runtime.exec what Max suggested to you. But depending on case you can also use some other approaches: TCP connection between jvm and node apps (or just some HTTP protocol) Or even use some integration for Java to allow execute node.js directly from jvm For example take a look on https://github.com/apigee/trireme Also there is pretty new and experimental, but promising Graal implementation https://github.com/graalvm/graaljs But yeah, for simplest use case just exec node as system program
o
wow, interesting! thank you!