N-API: The Next Generation Node.js API is Ready!
summary
N-API claims to deliver ABI stability across Node.js versions, letting native modules run without recompilation; the demo shows leveldown compiled once works on Node 8 (stable), Node 10 (stable/LTS) and moves between engines. About 30% of npm depends on native modules. The C API uses napi_status returns, a napi_env opaque token, napi_get_cb_info and napi_create_string_utf8 calls; node-addon-api provides a node-addon-api C++ wrapper. A NAN-to-N-API conversion script handles roughly 80% of changes and a native logger reports 4–7× speedups.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 2:21The challenge of native modules
- 7:42Understanding N-API
- 12:14Evolution from NAN to N-API
- 14:34Live demonstration
- 17:28Implementation details
- 22:10Code examples and conversion
- 25:10Community feedback and benefits
- 27:35Call to action and conclusion
related talks
26mN-API - next generation Node API for native modules
28mN-API - The new native in node.js
39mNext Generation N-API: A Hands-on Workshop
55mNode.js N-API for Rust
29mRust Native Module with Node-API
33mPanel: The State of Node.js
25mIntroduction to native extensions
31mBuilding Modern Native Add-ons for Node.js in 2021
