> ## Documentation Index
> Fetch the complete documentation index at: https://bun.ll1025.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Node-API

> 使用 Bun 的 Node-API 模块构建 Node.js 原生插件

Node-API 是用于构建 Node.js 原生插件的接口。Bun 从头实现了这个接口，因此大多数现有的 Node-API 扩展可以直接在 Bun 中使用。

与 Node.js 一样，您可以直接 `require()` `.node` 文件（Node-API 模块）。

```js theme={null}
const napi = require("./my-node-module.node");
```

或者，使用 `process.dlopen`：

```js theme={null}
let mod = { exports: {} };
process.dlopen(mod, "./my-node-module.node");
```
