Skip to content Skip to sidebar Skip to footer

Create New Node Module Object From Kotlin

I'm trying to write a small node.js application in Kotlin to test and play with the javascript interop. From an external node module 'foo' which exposes a prototype 'Bar', I am try

Solution 1:

I guess you have to define Bar as an external class from module foo:

@JsModule("foo")externalclassBar{
   ...
}

See https://kotlinlang.org/docs/reference/js-modules.html and https://kotlinlang.org/docs/reference/js-interop.html

Post a Comment for "Create New Node Module Object From Kotlin"