This blog post will explain the real reason behind renaming the N-API to Node-API was. We all might have seen the change from N-API to Node-API in the documentation within the Node.js project. Earlier pronounced as NAPI, N-API has always supported Node-API. However, many raised the concern about how it is pronounced. It was taken more like a derogatory term, due to which the change in the name was thought of. Hence, N-API is Node-API without really breaking the changes.
Let’s start with What’s Not Changing
- The first thing that will remain constant is the old symbols. Existing symbols like napi_create_reference will stay as it was earlier. It will ensure the ABI stability in such a way that the add-ons compiled earlier will remain as it is even in the new Node versions. It will load the same way as it used to earlier.
- Another thing that will remain the same is names like NAPI_MODULE, in node-addon-api the namespace, and the napi_status. The reason to keep it the same is to make sure the existing code is easily recompiled with almost no changes at all.
Now, What Has Really Changed?
Now, let’s see what is changing in the more recent versions!
- Node-API configuration via node command-line arguments will now be known as a new name. For instance,
- The names of the internally referenced folders have been changed. For example, the test folders, which were earlier named n-api, will now be known as node-api.
- The next on the list of what has changed is the API names like the features guards. They used to start with NAPI_ earlier and now will be renamed to NODE_API_. These are the externally facing API names.
- What also will be called Node-API now are the references such as blog posts and documentation.
- Now, let’s talk about the new symbols. These additions to Node-API and all other related projects will continue with the different prefixes like node_api_get_module_file_name
- Apart from that, the existing badges’ image content will be changed/updated to Node-API. However, this change will barely impact the URLs, as that will remain unchanged.
Hence, the change in the name was intended to avoid the concern of pronouncing it as a derogatory name and change it so something better. Also, the motive to change the name aimed at limiting the impact to users of Node-API. Besides, if you think you have any queries regarding this, you can always refer to this reliable source called Github right here.
The renaming from N-API to Node-API seems to be better due to the pronunciation of the existing name. This name change has happened but without majorly impacting or breaking what we already had. These are just a few yet critical changes that one must know before using Node.js. We hope you will follow through with these changes and will be able to utilize them in the best way possible for all your upcoming projects.