to mimic that same behavior in kotlinjs: ``` @JsMo...
# javascript
r
to mimic that same behavior in kotlinjs:
Copy code
@JsModule("express")
external object express {
    @JsName("call")
    operator fun invoke(): Application

    fun Router(): Router
}
allows you to do this in kotlinjs:
Copy code
val router = express.Router()
val app = express()
👍 3
k
Another way is:
Copy code
@JsModule("express")
external object express {
    fun Router(): Router
}

@JsModule("express")
external fun express(): Application
r
Ah yes, good call. I attempted something like that at first but I was defining express as a
class
with a
companion object
that held
Router
etc. but at that point I couldn’t have
class
and
function
with the same name. However under this setup having an
object
and
fun
with the same presents no issue.