Skip to content

Modules

Joakim edited this page Oct 25, 2021 · 17 revisions

Import

import module: 'module.kesh'
import [foo]: 'module.kesh'
import [foo as alias]: 'module.kesh'
import [foo, bar]: 'module.kesh'
import 'module.kesh'

The import declaration can also import individual items from the global object.

import JSON
import Promise
import Math

Export

A module's last evaluated expression is implicitly exported.

sum: (a, b) -> a + b
diff: (a, b) -> a - b

[sum, diff]
Clone this wiki locally