Skip to content

JSModules

use

use <js_module_name>

For importing JS/Node/Bun/Whatever modules.

Example:

use example

Translates to:

const example = require("example");

val variable = use(<js_module_path>)

Imports a module from the specified path and assigns it to a constant variable.

Example:

val x = use("./asdf")

Translates to:

const x = require("./asdf");