This repository is the home for ABI Stable Node API project (N-API). The goal of this project is to provide a stable Node API for native module developers. N-API aims to provide ABI compatibility guarantees across different Node versions and also across different Node VMs – allowing N-API enabled native modules to just work across different versions and flavors of Node.js without recompilations.
It is introduced by this Node enhancemnet proposal: 005-ABI-Stable-Module-API.md.
This is project is in experimental stage at the moment. During the latest VM Summit, we discussed the progress of this project. The summit participants agreed to consider a PR for this feature as experimental in the upcoming Node.js version 8.0. You can checkout the Notes from Node.js VM Summit for more details.
Branches
This repository contains node sources from Node versions 0.10, 0.12, 6.2, 8.x and Node-ChakraCore version 7.x and 8.x with addition of ABI stable Node APIs. The branches are named according to the node versions that have been enabled with N-API support. Recently updated branches are the following:
Branches for older Node versions were to test the resiliency of N-APIs across different Node versions. The PR will be submitted using the api-prototype-8.x branch which is tracking the latest Node.js master.
API Design & Shape
The current shape of the API can be found in header file node_api.h
There is also a header-only C++ API, which simplifies development while still using the same ABI-stable Node API underneath. It will be distributed as a separate npm package.
N-API enabled modules
Module | Converted By | Location | Conversion Status | Performance Assesment |
---|---|---|---|---|
leveldown | boingoing / ianwjhalliday / jasongin | https://github.com/jasongin/leveldown/tree/napi | Completed | #55 |
nanomsg | sampsongao | https://github.com/sampsongao/node-nanomsg/tree/api-opaque-prototype | Completed | #57 |
canvas | jasongin | https://github.com/jasongin/node-canvas/tree/napi | Completed | #77 |
node-sass | boingoing / jasongin | https://github.com/boingoing/node-sass/tree/napi | Completed | #82 |
iotivity | gabrielschulhof | https://github.com/gabrielschulhof/iotivity-node/tree/abi-stable | Completed | N/A |
node-sqlite3 | sampsongao / mhdawson | https://github.com/mhdawson/node-sqlite3/tree/v3.1.4-abi | Started |
Testing
In addition to running the tests in the converted modules. We have also
-
Converted version of the NAN examples abi-stable-node-addon-examples
-
Converted version of the core addons tests which can be run with
make test addons-napi
How to get involved
- Convert a native module to use N-API and report issues on conversion and performance;
- Port ABI stable APIs to your fork of Node and let us know if there are gaps;
- Review the roadmap and see how can you can help accelerate this project.
Hangout link for weekly standup https://plus.google.com/u/0/events/c0eevtrlajniu7h8cjrdk0f56c8?authkey=COH04YCalJS8Ug
- aruneshchandra - Arunesh Chandra
- boingoing - Taylor Woll
- digitalinfinity - Hitesh Kanwathirtha
- gabrielschulhof - Gabriel Schulhof
- ianwjhalliday - Ian Halliday
- jasongin - Jason Ginchereau
- mhdawson - Michael Dawson
- sampsongao - Sampson Gao