Skip to content

yuku-toolchain/napi-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

112 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

napi-zig

Build Node.js native addons in Zig. Cross-compile every platform from one machine. Publish to npm with one command.

const napi = @import("napi-zig");

comptime { napi.module(@This()); }

pub fn add(a: i32, b: i32) i32 {
    return a + b;
}
import addon from "./my-addon.js";
addon.add(2, 3); // 5

Quick start

npx napi-zig@latest new my-addon
cd my-addon
node test.mjs

That's it. You have a working native Node.js addon written in Zig.

Documentation

Full guides, API reference, and the publish pipeline:

napi-zig.dev

License

MIT

About

The simplest way to write cross-platform Node.js native addons in Zig.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors