zerojs.package
- ..
- .metadata17 B
- README.md1.0 KB
- about.yaml675 B
- behavior.luau17.3 KB
- template
- type.yaml433 B
README.md
zJs (asset type)
A zJs asset is a JavaScript ES module: a <name>.zJs/ folder whose main.js
holds JavaScript source parsed and evaluated by the zerojs interpreter. The
identity is <name> (the .zJs suffix strips).
Folder shape
main.js— the module body. Required.README.md— instance documentation. Required..metadata— tags sidecar ({"tags": []}). Required.
How to create one
asset.create("zJs", "greeter")
-- Creates /zero/source/greeter.zJs/ with a hello-world main.js.
asset.create("zJs", "greeter", { source = "export const x = 1" })
-- main.js is the given source verbatim.
Static diagnostics
Every write to main.js reparses the module and resolves its import
specifiers against the live asset index. asset.resolve("<name>", "zJs"):check()
returns { ok, diagnostics }: ok is true when the module parses and every
import resolves to another zJs module; each diagnostic carries a severity,
message, line, and col. No JavaScript runs during a check.