# node-ffi-napi/node-ffi-napi

A foreign function interface (FFI) for Node.js, N-API style

Repository: https://github.com/node-ffi-napi/node-ffi-napi
Canonical: https://ross.abutalabs.com/products/node-ffi-napi
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2024-08-16T13:44:45+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3201, "days_push": 747, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1097, forks 155 (observed 2026-08-28T04:03:34.597869+00:00)

## What it is
node-ffi-napi is a Node.js addon providing a foreign function interface (FFI) for loading and calling dynamic native libraries from pure JavaScript, without writing C++ binding code. It handles type translation between JavaScript and C and bundles libffi.

## Use cases
- call functions from a C shared library in Node.js
- create Node.js bindings to a native library without writing C++
- invoke libc functions like atoi from JavaScript
- wrap an existing .so/.dll/.dylib for Node.js use
- prototype native code interop from pure JavaScript

## When to choose
- you need to call a native dynamic library from Node.js quickly without writing a C++ addon
- you want to avoid node-gyp boilerplate for simple native function calls
- you need cross-platform FFI on Linux, macOS, or Windows

## When to avoid
- your native code is multi-threaded or relies on well-defined garbage-collection semantics
- you need long-term maintained support - the project is in maintenance mode and newer alternatives like koffi or node-API addons exist
- you cannot tolerate potential segfaults from incorrect type or pointer usage

## Facets
- artifact type: library
- maturity: maintenance
- function: sdk, developer-tools
- domain: developer-tools, cross-platform
- platform: windows, cross-platform
- tags: ffi, napi, native-bindings, dynamic-libraries, libffi, nodejs-addon, nodejs, linux, macos

## Member repositories
- node-ffi-napi/node-ffi-napi (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:34.597869+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:46:36.398744+00:00, confidence not recorded.
  - readme: https://github.com/node-ffi-napi/node-ffi-napi (fetched 2026-08-28T04:03:34.597869+00:00, sha 0248e7dadcd4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
