nodejs-interop / net.plan99.nodejs.kotlin

Package net.plan99.nodejs.kotlin

Types

NodeJSAPI

The API for working with the NodeJS world. Accessed by using a nodejs block: the methods on this class are in scope when inside the code block.

class NodeJSAPI

Functions

nodejs

Enters the NodeJS event loop thread and makes the JavaScript API available in scope. You can return JavaScript objects from a nodejs block, however, you can't access them again until you're back inside. Attempting to use them outside a nodejs block will trigger a threading violation exception.

fun <T> nodejs(body: NodeJSAPI.() -> T): T