Skip to main content

Node-API

Node-API is an interface for building native add-ons to Node.js. Bun implements this interface from scratch, so most existing Node-API extensions work with Bun out of the box.

As in Node.js, you can require() .node files (Node-API modules) directly.

const napi = require("./my-node-module.node");

Alternatively, use process.dlopen:

let mod = { exports: {} };
process.dlopen(mod, "./my-node-module.node");
Translation © 2026 fanyi.dev · Original © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)