[ Web Proxy ]
URL:
Viewing: https://bun.com/docs/runtime/node-api [Back]  [Original]

Node-API | Bun Docs
Skip to content
[]DocsGuidesReferenceBlog
Search docs, APIs, guides/
Browse docs
Runtime
  1. Runtime
  2. Interop & Tooling

Node-API

Use Bun's Node-API module to build native add-ons to Node.js

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");
PreviousCronNextFFI
Ask AI

Web Proxy Viewer  |  New URL  |  Original Page