I just created a project using gradle + Kotlin JS ...
# announcements
h
I just created a project using gradle + Kotlin JS and I want to use File class from Kotlin Jvm
z
You can’t use JVM-specific things in Kotlin JS. Various javascript environments provide their own IO APIs, e.g. nodejs has its own.
You can create
expect
abstractions in your common source set that have
actual
implementations in each platform that use the platform-specific IO apis.
h
Ummm... Got it
Do you have some sample? how can I call js code from kotlin
I'd like to use this IO apis from JS
z
Also, kotlin 1.4.0-rc introduced typesafe nodejs bindings: https://github.com/Kotlin/kotlinx-nodejs
😮 1
✔️ 2
👍 2