Zig runtime
Entry and registration
Import the package as napi and register public declarations at comptime:
src/root.zig is the public runtime entry. It exports c, dts, index_js, Error, Env, Val, BigIntFit, Callback, ThreadsafeFn, CallInfo, Ref, Deferred, class, and module.
Editing rules
- Preserve Node-API ownership, lifetime, and error behavior.
- Keep exported declarations compatible with automatic TypeScript declaration generation.
- Cover new conversions and runtime behavior in
src/tests.zigandtests/library/. - Cover public declaration shapes in
tests/dts/when types change. - Format Zig changes with
zig fmtand runzig build testbefore broader tests.
Use the detailed pages beside this file for user-facing examples and individual exported types. Start with functions, type conversion, async workers, or the runtime API reference, depending on the affected surface.