https://kotlinlang.org logo
#javascript
Title
# javascript
r

Renegade Master

06/30/2022, 11:57 PM
Is there a recommended way to read files from a project's Resources folder in Kotlin JS?
b

Big Chungus

07/01/2022, 7:58 AM
Browser or nodejs?
c

Chukwukammadu Anizoba

07/01/2022, 9:57 AM
Would also highly appreciate tips for Browser env specifically @Big Chungus
b

Big Chungus

07/01/2022, 10:00 AM
Your only option then is simply use fetch api with relative paths
I.e. fetch("./my.properties").then {console.log(it)}
Assuming my.properties is at the resources folder root
c

Chukwukammadu Anizoba

07/01/2022, 10:04 AM
Makes a ton of sense. Thanks!