nodejs

nodejs/node-addon-examples

C++ No license Dev Tools License not recognized by GitHub

Node.js C++ addon examples from http://nodejs.org/docs/latest/api/addons.html

2.6k stars
601 forks
recent
GitHub

2.6k

Stars

601

Forks

63

Open issues

30

Contributors

AI Analysis

A curated collection of Node.js C++ addon examples demonstrating best practices for native module development across multiple binding APIs (Node-API, nan, node-addon-api). It serves as the official reference material for C++ developers extending Node.js functionality, and is primarily valuable for systems programmers and library authors who need native performance or OS-level access—not for general application developers.

Dev Tools Developer Tool Discovery value: 4/10
Documentation 8/10
Activity 8/10
Community 7/10
Code quality 6/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 7/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

nodejs-native c++-bindings node-api systems-programming educational-reference
Actively maintained Well documented Educational Niche/specialized use case Beginner friendly
Deep Analysis · Based on README and public signals
4d ago

Official Node.js C++ addon examples spanning N-API, node-addon-api, and legacy patterns

node-addon-examples is the canonical reference repository maintained by the Node.js project, housing practical implementations of the same addon pattern across multiple abstraction APIs (N-API, node-addon-api, nan). It serves as the primary learning resource and validation target for developers building native extensions to Node.js. Used internally by Node.js maintainers and referenced extensively in official documentation and community guides.

Origin

Created January 2013 as Node.js addon documentation evolved from direct V8 API bindings toward abstraction layers. Evolved with Node.js itself, tracking shifts from nan-based patterns (2013–2017) to N-API (2017+) and node-addon-api (2018+). Now primarily a reference implementation repository rather than a library.

Growth

Stars plateau around 2,500–2,600 for over a year; growth was strong during 2017–2019 N-API adoption phase. Recent activity (last commit June 29, 2026, zero stars in last 7 days) reflects maturity and stability rather than viral growth. This is expected for a reference repository: shallow clones and documentation links drive consumption more than starred forks.

In production

This is a reference repository, not a production library. Adoption not measured by production deployments but by: (1) link density in Node.js official documentation, (2) reference in community addon tutorials and blogs, (3) use by Node.js maintainers in API validation. Internal Node.js CI likely runs examples as validation checks. Direct production adoption would be misaligned with purpose.

Code analysis
Architecture

Based on README, likely organizes examples by complexity tier (getting-started through tooling) and implementation API (N-API C, node-addon-api C++, nan). Appears to maintain separate example directories for each abstraction to allow side-by-side comparison. Structure suggests pedagogical intent rather than production library design.

Tests

README mentions a `test_all.js` file but does not detail test coverage philosophy. Not documented in README excerpt provided.

Maintenance

Last push June 29, 2026 (8 days from analysis date) indicates active, minimal-churn maintenance. No star gain last 7 days typical for mature reference documentation. Commit frequency likely irregular because updates are driven by Node.js API changes and example clarity improvements rather than feature velocity.

Honest verdict

ADOPT IF: You are learning to write Node.js C++ addons, need clear side-by-side comparisons of N-API vs node-addon-api vs nan approaches, or maintain Node.js addon-related infrastructure. AVOID IF: Looking for a production library or SDK—this is reference material, not consumable code. MONITOR IF: You maintain a Node.js addon and Node.js introduces new C++ bindings or ABI changes; examples should be checked for accuracy and updated.

Independent dimensions

Mainstream potential

2/10

Technical importance

7/10

Adoption evidence

6/10

Risks
  • Examples may lag behind bleeding-edge Node.js C++ API changes by several releases, though README suggests historical examples are kept for context.
  • Reference examples are idealized and may not show error handling, performance optimization, or production patterns (memory management edge cases).
  • Maintenance depends on Node.js core team bandwidth; spikes in new Node versions can cause temporary staleness.
  • Limited evidence of community contributions; unclear if pull requests for example improvements are actively triaged.
  • No guarantees examples compile or run on all supported Node.js versions despite intent; build environment dependency may cause silent failures.
Prediction

Will remain stable, minimally updated reference maintained as part of Node.js documentation infrastructure. Unlikely to receive major expansion; may gradually deprecate unsupported version examples and add minimal N-API clarifications as the API matures.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

C++
63.8%
C
18%
JavaScript
9.8%
Python
6.3%
CMake
2%
TypeScript
0.1%

Information

Language
C++
License
NOASSERTION
Last updated
2w ago
Created
164mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Recent releases

No releases published yet.

Similar repos

nodejs

nodejs/node-addon-api

node-addon-api is a header-only C++ wrapper library that simplifies using...

2.4k C++ Dev Tools
nodejs

nodejs/nan

NAN (Native Abstractions for Node.js) is a header-only C++ library that...

3.4k C++ Dev Tools
mdn

mdn/webextensions-examples

This is Mozilla's official collection of simple, complete, and installable...

4.5k JavaScript Dev Tools
mapbox

mapbox/node-pre-gyp

node-pre-gyp is a Node.js tool that simplifies publishing and installing C++...

1.2k JavaScript Dev Tools
nodejs

nodejs/node-gyp

node-gyp is a cross-platform command-line build tool for compiling native C/C++...

10.7k Python Dev Tools
vs. alternatives
nodejs/node-addon-api

Sibling project (2,401 stars). node-addon-api is the header-only library itself; node-addon-examples provides didactic implementations of it. Complementary, not competitive.

nodejs/nan

Predecessor abstraction (3,355 stars). Examples still include nan implementations for historical context and legacy support. nan is older but less recommended for new projects per official guidance.

nodejs/node-gyp

Build tool (10,660 stars, Python). Different layer: node-gyp handles compilation; node-addon-examples show what code to compile. Orthogonal tools.

mapbox/node-pre-gyp

Binary distribution layer (1,154 stars). Handles pre-built addon distribution; node-addon-examples focus on authoring source. Different problem domain.