@teakit/napi
@teakit/napi is a Zig toolkit for building Node-API addons. The Zig package and import name is napi; the npm CLI package, executable, and command name is napikit.
Minimal module
Public contract
- Runtime entry:
src/root.zig. - Build entry:
build.zig, especiallyaddLib,LibOptions,NpmConfig,Dts,Import, andPlatform. - CLI entry:
napikit new,build,bump,publish, andnpm-init. - Generated addons use
.nodebinaries, JavaScript bindings, and optional declarations. .dts = .noneemits no declaration,typesfield, orindex.d.tspackage entry; a release rebuild removes the stale build-owned declaration when switching to.none.- Toolchain baseline: Zig
0.16.0, Bun1.3.14for this repository, and Node.js>=20.19.0for the publishednapikitCLI. - Public docs: https://napi.teakit.org.
- Source repository: https://github.com/teakit/napi.
Reference map
- Start with quick start, manual setup, or the project layout.
- For addon code, use the functions, type conversion, memory, errors, and callbacks guides.
- For concurrency, use workers, thread-safe functions, and promises.
- For delivery, use TypeScript declarations, cross-compiling, and publishing.
- Individual APIs are indexed by
teakit-napi/SKILL.md.
Repository commands
Use teakit-napi/SKILL.md for task workflow, guardrails, and complete reference routing.
For repository maintenance, .github/workflows/quality.yml defines the five canonical checks and .github/workflows/publish-to-npm.yml releases the CLI. The addon scaffolder writes a separate .github/workflows/publish.yml into generated projects.