Hello. I am writing a multiplatform library which ...
# javascript
e
Hello. I am writing a multiplatform library which will be used by desktop and web applications also. I want to use Kotlin JS with electron or something similar and I want to access Filesystem apis via Node js exclusively for desktop version. So right now I am trying to find a way to achive this. I am thinking of 2 ways but dont know what to do technically. First one is to use directly electron and its nodeIntegration feature but I couldn't use node apis via Kotlin. (Tried to run in electron window but getting 'fs' not found error and I don't have an idea how to configure Webpack) Second one is to render the application in a local server and show it in electron but I dont know is it technically possible with Kotlin or not What you guys recommend me to do?
r
You should be able to use Kotlin/JS with Electron without problems. Look at this example app: https://github.com/rjaros/kvision-examples/tree/master/template-electron
It's using KVision, but you should be able to use the same configuration without it.
All other code is Kotlin.
User https://github.com/Kotlin/kotlinx-nodejs library for node API.
e
Thanks for response. I am looking into it now