Node.js

Node.js Update: Renaming N-API to Node-API

This post was contributed by the Node-API team and was initially published on the Node.js Medium Blog. Node.js is a hosted project of the OpenJS Foundation.

Node.js Update: Renaming N-API to Node-API

This post was contributed by the Node-API team and was initially published on the Node.js Medium Blog. Node.js is a hosted project of the OpenJS Foundation.

The reason for this blog post is to explain what motivated us to rename N-API to Node-API. The issue that is tracking the transition was: https://github.com/nodejs/abi-stable-node/issues/420

Background
You may have noticed N-API changed to Node-API in the documentation within the Node.js project. N-API has always stood for Node-API but was often pronounced NAPI. A concern was raised, that when pronounced that way, it could be mistaken for a derogatory term. We therefore made it our goal to clarify that N-API is Node-API whenever possible without introducing breaking changes.

What’s changing (only in more recent versions):

  • References: Documentation, blog posts, and similar will now refer to “Node-API”.
  • Folders: Internally referenced folders (eg. test folders) have been renamed from n-api to node-api.
  • Badges hosted on Node repositories: Existing badges’ image contents have been updated to “Node-API” without changing their URLs.
  • New symbols: Additions to Node-API and related projects will now have a different prefix, eg. node_api_get_module_file_name.
  • Types, macros, and defines: Externally-facing API names, such as features guards, will now start with NODE_API_ instead of NAPI_
  • New node arguments: Node-API configuration via node command line arguments, eg.- -force-node-api-uncaught-exceptions-policy, will refer to the new name.

What’s not changing:

  • Old symbols: Existing symbols (eg. napi_create_reference) will remain the same. This ensures ABI stability, such that a previously compiled add-on will continue to load in newer Node versions.
  • Types, macros and defines: Names like napi_status, NAPI_MODULE, the Napi namespace (in node-addon-api) will remain the same. This ensures existing code can be recompiled with no changes.

We believe that we’ve made this change in a way that addresses the issue while limiting the impact to users of Node-API and hope this post helps you understand the approach and what to look out for. As always if you have any questions/concerns please open an issue in https://github.com/nodejs/abi-stable-node or https://github.com/nodejs/node-addon-api.