> For the complete documentation index, see [llms.txt](https://nongchatea.gitbook.io/koffi-chinese/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nongchatea.gitbook.io/koffi-chinese/koffi.md).

# KOFFI

<figure><img src="https://1094181026-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKISYl6UITmbnfRVm7kuf%2Fuploads%2FSSUhT5oxRvXZD52brBDF%2Fnode_c.webp?alt=media&amp;token=a39fc539-e666-451c-b061-22d119cc6042" alt=""><figcaption><p>koffi</p></figcaption></figure>

## 概述

Koffi 是一个**快速且易于使用的 Node.js C FFI 模块**，具有以下特点：

* 低开销和快速性能（参见[基准测试](https://koffi.dev/benchmarks#benchmarks)）
* 通过引用（指针）和值支持原始和聚合数据类型（结构和固定大小数组）
* Javascript 函数可以用作 C 回调（自 1.2.0 起）
* [针对流行操作系统/架构组合](/koffi-chinese/an-zhuang-xu-qiu.md#zhi-chi-de-ping-tai)的经过良好测试的代码库

Koffi 需要具有 N-API 版本 8 支持的最新[Node.js版本，请参阅](https://nodejs.org/)[此页面](https://koffi.dev/platforms#node-js)了解更多信息。

源代码可在此处获取：<https://github.com/Koromix/rygel/> （在*src/koffi*子目录中）。

新版本频繁发布，请查看[变更日志](https://koffi.dev/changelog#changelog)以获取更多信息。
