Namespaces
Group related exports under a struct. Each pub const whose value is a struct with pub fn members becomes a nested JS namespace.
Arbitrary nesting
Namespaces nest as deeply as you want. The walker recurses through every public struct.
Splitting across files
Anonymous struct {} literals work, but in practice you will want to split into files. @import in Zig produces a struct, which is exactly what the walker is looking for:
The crypto namespace ends up identical to the inline version.
Constants and properties
A pub const that holds a JS-mappable value (number, string, enum, struct literal) becomes a JS property:
If a pub const is a type or a value the converter cannot map, it is silently skipped. (You will not see it in the output and you will not get a comptime error for it.)