Building Modern Native Add-ons for Node.js in 2021
summary
Covers concrete Node‑API changes: thread-safe functions with configurable initial thread count, max queue size and blocking vs non‑blocking posts; the Addon class and napi_set_instance_data for per‑instance state so native modules load safely in multiple JS worlds; async worker variants (progress, progress queue) and example increment binding that replaces global statics; new helpers for BigInt, Date, detaching ArrayBuffer, freeze/seal and UUID tagging; build/deploy options: node‑gyp or CMake.js plus prebuilt binaries via node‑pre‑gyp or prebuild and migration paths from NAN (MongoDB port cited).
AI-written summary · about
chapters (9)
- 0:00Start
- 1:17Building Native Addons - compile code when installing package
- 2:29Installing Pre-Built Binaries - download if exists, otherwise build
- 7:17AsyncProgress Worker
- 7:48AsyncProgress Queue Worker
- 8:16Thread-safe Functions
- 17:31Self-Contained Add-ons - Tools - Addon and NODE API ADDON ()
- 21:16Additional Helper Methods - Node-API 8
- 24:31Resources for Getting Started








