whatisgithub

What is node-addon-api?

nodejs/node-addon-api — explained in plain English

Analysis updated 2026-05-18

2,391C++Audience · developerComplexity · 4/5LicenseSetup · hard

In one sentence

A header-only C++ wrapper around Node-API that makes it easier to write native add-ons for Node.js.

Mindmap

mindmap
  root((node-addon-api))
    What it does
      Wraps Node-API in C++
      Header only library
      Error handling classes
    Tech stack
      C++
      Node.js
      Node-API
    Use cases
      Native add-on development
      Version portable add-ons
      Performance critical code
    Audience
      Native module developers
      C++ engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Write a Node.js native add-on in C++ with cleaner syntax than raw Node-API.

USE CASE 2

Build an add-on that keeps working across multiple Node.js versions without recompiling.

USE CASE 3

Add proper C++ exception handling to native module code.

What is it built with?

C++Node.jsNode-API

How does it compare?

nodejs/node-addon-apimicrosoft/intelligent-terminalendee-io/endee
Stars2,3911,3491,320
LanguageC++C++C++
Last pushed2026-07-03
MaintenanceActive
Setup difficultyhardeasymoderate
Complexity4/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a C++ build toolchain and familiarity with Node-API to use effectively.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

This repository provides a set of C++ helper files that make it easier to write native add-ons for Node.js. Node.js normally runs JavaScript, but sometimes developers want to call code written in C++ for performance reasons or to access system-level features. To do that, they need to interface with Node-API, which is the official way Node.js exposes its internals to native code. That interface is written in C, which can be verbose and tricky to use directly. This module wraps that C interface with cleaner C++ classes and adds proper error-handling patterns, making the same work significantly less tedious. The wrapper is header-only, meaning it consists of files you include in your project rather than a separate library you compile and link against. This keeps the overhead low. The module is versioned alongside Node-API versions, and add-ons built with it can run across multiple versions of Node.js as long as the targeted Node-API version is supported by the Node.js version in use. The current release is version 8.8.0, and it supports Node.js 18 and newer. Each major release of node-addon-api eventually drops support for Node.js versions that have reached end of life, following the active long-term-support schedule. The repository is maintained by a small team of contributors listed in the README. Documentation for the full API lives in the doc folder. The project is licensed under MIT and welcomes contributions following the guidelines in the CONTRIBUTING file.

Copy-paste prompts

Prompt 1
Show me a minimal example of a Node.js native add-on using node-addon-api.
Prompt 2
Explain how Node-API versioning affects which Node.js releases my add-on supports.
Prompt 3
Help me convert a raw Node-API C function into node-addon-api's C++ style.
Prompt 4
What does header-only mean for how I include this in my build.

Frequently asked questions

What is node-addon-api?

A header-only C++ wrapper around Node-API that makes it easier to write native add-ons for Node.js.

What language is node-addon-api written in?

Mainly C++. The stack also includes C++, Node.js, Node-API.

What license does node-addon-api use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is node-addon-api to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is node-addon-api for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.