| [81bc7da] | 1 | # Node.js ABI
|
|---|
| 2 |
|
|---|
| 3 | [](https://github.com/electron/node-abi/actions/workflows/test.yml)
|
|---|
| 4 | [](https://github.com/electron/node-abi/actions/workflows/update-abi.yml)
|
|---|
| 5 | [](https://snyk.io/test/github/electron/node-abi)
|
|---|
| 6 | [](https://npmjs.org/package/node-abi)
|
|---|
| 7 |
|
|---|
| 8 | Get the Node ABI (application binary interface) for a given target and runtime, and vice versa.
|
|---|
| 9 |
|
|---|
| 10 | ## Installation
|
|---|
| 11 |
|
|---|
| 12 | ```shell
|
|---|
| 13 | npm install node-abi
|
|---|
| 14 | ```
|
|---|
| 15 |
|
|---|
| 16 | ## Usage
|
|---|
| 17 |
|
|---|
| 18 | ```javascript
|
|---|
| 19 | const nodeAbi = require('node-abi')
|
|---|
| 20 |
|
|---|
| 21 | nodeAbi.getAbi('7.2.0', 'node')
|
|---|
| 22 | // '51'
|
|---|
| 23 | nodeAbi.getAbi('1.4.10', 'electron')
|
|---|
| 24 | // '50'
|
|---|
| 25 | nodeAbi.getTarget('51', 'node')
|
|---|
| 26 | // '7.2.0'
|
|---|
| 27 | nodeAbi.getTarget('50', 'electron')
|
|---|
| 28 | // '1.4.15'
|
|---|
| 29 |
|
|---|
| 30 | nodeAbi.allTargets
|
|---|
| 31 | // [
|
|---|
| 32 | // { runtime: 'node', target: '0.10.48', abi: '11', lts: false },
|
|---|
| 33 | // { runtime: 'node', target: '0.12.17', abi: '14', lts: false },
|
|---|
| 34 | // { runtime: 'node', target: '4.6.1', abi: '46', lts: true },
|
|---|
| 35 | // { runtime: 'node', target: '5.12.0', abi: '47', lts: false },
|
|---|
| 36 | // { runtime: 'node', target: '6.9.4', abi: '48', lts: true },
|
|---|
| 37 | // { runtime: 'node', target: '7.4.0', abi: '51', lts: false },
|
|---|
| 38 | // { runtime: 'electron', target: '1.0.2', abi: '47', lts: false },
|
|---|
| 39 | // { runtime: 'electron', target: '1.2.8', abi: '48', lts: false },
|
|---|
| 40 | // { runtime: 'electron', target: '1.3.13', abi: '49', lts: false },
|
|---|
| 41 | // { runtime: 'electron', target: '1.4.15', abi: '50', lts: false }
|
|---|
| 42 | // ]
|
|---|
| 43 | nodeAbi.deprecatedTargets
|
|---|
| 44 | nodeAbi.supportedTargets
|
|---|
| 45 | nodeAbi.additionalTargets
|
|---|
| 46 | nodeAbi.futureTargets
|
|---|
| 47 | // ...
|
|---|
| 48 | ```
|
|---|
| 49 |
|
|---|
| 50 | ## References
|
|---|
| 51 |
|
|---|
| 52 | - https://github.com/lgeiger/electron-abi
|
|---|
| 53 | - https://nodejs.org/en/download/releases/
|
|---|
| 54 | - https://github.com/nodejs/Release
|
|---|