nodejs-interop / net.plan99.nodejs.kotlin / NodeJSAPI / bind

bind

fun <T> bind(default: T? = null): Binder<T>

Use this in property delegate syntax to access top level global variables in the NodeJS context. By declaring a variable as var x: String by bind() you can read and write the 'x' global variable in JavaScript world.