Dowload Node.js N-API headers
npm install napi-headersnpm CLI to download Node.js N-API headers and/or node-addon-api headers (for C++).
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
``bash`
$ npm install napi-headers -gor
$ npx napi-headers
When installed globally the nodehead (or napihead) executable will be exposed in your terminal.`bash`
$ nodehead -c -o ./include

`js
const headers = require("napi-headers");
headers.napi(process.cwd()).catch(console.error)
`
| argument | shortcut | description | default value |
| --- | --- | --- | --- |
| --napi | -n | Download Node.js N-API Headers | false |
| --cpp | -c | Download node-addon-api Headers | false |
| --output | -o | Ouput directory for headers | process.cwd()/include |
When --cpp is requested, --napi is ignored because node-addon-api already include Node.js N-API headers.
> Note: when output is undefined, the include directory will be created automatically !
bash
$ nodehead -n v11.0.0
`$3
If you want to download a given version of node-addon-api (for headers), just write:
`bash
$ nodehead -c 1.6.0
``