1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
- -------
<a name="introduction"></a>
**node-api-headers** contains the header files for the C-based Node-API
provided by Node.js. Node-API is an API for building native addons that
guarantees the ABI (Application Binary Interface) stability across versions
of Node.js (see: [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)).
Node-API headers are in the `include` folder. The Node-APIs that provide
ECMAScript features from native code can be found in `js_native_api_types.h`
and `js_native_api.h`. The APIs defined in these headers are included in
`node_api_types.h` and `node_api.h`.
The headers are structured in this way in order to allow implementations of
Node-API outside of Node.js considering that for those implementations the
Node.js specific APIs may not be applicable.
**node-api-headers** is also a package published on **npm** that could be used
in a process to compile and build native addons for Node.js.
<a name="install"></a>
```
npm i node-api-headers
```
<a name="versions"></a>
Node-API C headers are backward-compatible. Its version (e.g. `8`) is released
separately from the Node.js version stream (e.g. `19.8.1`) and changes are
backported to active Node.js LTS lines (e.g. `16.x` and `18.x`).
This package publishes semver-minor versions with new Node-API C headers changes.
JS API breaking changes are published with new semver-major versions.
<a name="api"></a>
The module exports two properties `include_dir` and `symbols`.
This property is a string that represents the include path for the Node-API
headers.
This property is an object that has two keys `js_native_api_def` and
`node_api_def` which represents the path of the module definition file for the
`js_native_api` and `node_api` respectively.
This property is an object that represents the symbols exported by Node-API
grouped by version and api types.
```js
// ...
```
<a name="team"></a>
The project is maintained by the [Node-API team members](https://github.com/nodejs/abi-stable-node/?tab=readme-ov-file#project-participants).
<a name="license"></a>
Licensed under [MIT](./LICENSE.md)