node-api-headers

Official C header files and symbol lists for building Node-API native addons

Library
npm
v1.9.0
42stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
34/100Needs Attention
Development Activity20
Maintenance24
Community20
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture74
Code Quality76
Innovation68
Learning Curve72

node-api-headers is the official Node.js package that packages the C header files for Node-API, the ABI-stable interface for building native addons. Node-API guarantees Application Binary Interface stability across Node.js versions, so addons compiled against these headers keep working without recompilation as Node.js is upgraded.

Alongside the headers in the include folder, the package exposes a small JavaScript API that reports the include directory path and lists the exported Node-API and JS Native API symbols. Build tools such as cmake-js and node-gyp consume it to locate the correct headers and generate the symbol definition files needed to link native modules.

What You Get

  • The complete set of Node-API C headers (node_api.h, js_native_api.h, and their type headers) in an include folder
  • A JavaScript API returning the include directory and arrays of exported Node-API symbols
  • Symbol lists and Windows .def definition data for generating import libraries
  • ABI stability so addons compiled against the headers survive Node.js version upgrades
  • Header sets separated into Node-specific and pure JS Native API groups for non-Node implementations

Common Use Cases

  • Providing Node-API headers to native addon build tools like cmake-js and node-gyp
  • Generating platform import libraries from the bundled symbol and def data
  • Compiling ABI-stable C/C++ native addons that outlive Node.js version changes
  • Building alternative Node-API implementations outside of Node.js using the split header sets

Under The Hood

Architecture - The package is primarily a curated collection of C headers under include/ (node_api.h, node_api_types.h, js_native_api.h, js_native_api_types.h) plus a thin JavaScript layer. index.js exports the absolute include directory and re-exports symbol data from symbols.js, which enumerates the Node-API and JS Native API function symbols. A def/ folder and scripts/ (update-headers, write-symbols, write-win32-def) regenerate the headers and symbol/def artifacts from upstream Node.js sources.

Tech Stack - The distributed contract is C header files; the tooling and API layer are plain JavaScript with no runtime dependencies. Maintenance scripts parse upstream Node.js headers to keep symbol lists and Windows .def files current. Releases are automated via release-please.

Code Quality - As an official Node.js org project it follows the project’s contribution and code-of-conduct standards, ships a test/ suite (parse-utils.js) validating the symbol parsing, and uses release-please for consistent, changelog-backed releases. The scope is deliberately narrow and stable, which keeps the surface easy to reason about.

API Design - The JavaScript API is minimal by design — an include path and symbol arrays — because the real product is the header set consumed by C/C++ compilers. For addon authors this package is usually a transitive dependency of a build tool rather than something used directly, so day-to-day ergonomics are inherited from tools like cmake-js and node-addon-api built on top of it.”

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search