Is there a library to generate js on jvm, Just li...
# kotlinx-html
a
Is there a library to generate js on jvm, Just like html and css
r
You'll need to use kotlinjs. Make it a multiplatform project. Have a main class in your js, e.g. mine is named Recipe:
Copy code
@OptIn(ExperimentalJsExport::class)
@JsExport
object Recipe {
...
}

@OptIn(ExperimentalJsExport::class)
@JsExport
fun main() {
    Recipe
}
Then in your server code, you can import this:
Copy code
fun HEAD.bundleInit() {
        script {
            src="/static/main.bundle.js"
        }
    }
Ask in the #javascript channel for help setting up the build if you need.
c
Like @Reuben Firmin said you can use Kotlin to compile to JS (this has nothing to do with the JVM). You can also just use JS or TypeScript (or other options, we really like Elm).