Is there any Java library to convert Kotlin to Jav...
# javascript
v
Is there any Java library to convert Kotlin to JavaScript code? I have a String s = "contains Kotlin code"; which I want to convert to a JavaScript code? is it possible?
u
visruth: you can write content to a file run kotlin compiler to generate js
v
Okay but my use case is different.
I have a project which declares JavaScript code in String. It's kept at server side and shares it to the client when needed. So if it's possible to convert Kotlin code to JavaScript code with the help of a jar then I can replace all JavaScript strings with Kotlin in my project and later I can convert it to javascript on demand.
b
You can use kotlin-compiler.jar as library
v
Thank you. let me have a look at it.
I think it will help, the framework I'm using is https://webfirmframework.github.io so I have to keep JavaScript code at server side. If your solution is efficient enough (i.e. takes no much memory and cpu) then I can use it in my whole project. Thanks for your help.