Socket
Socket
Sign inDemoInstall

node-abi

Package Overview
Dependencies
3
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-abi

Get the Node ABI for a given target and runtime, and vice versa.


Version published
Weekly downloads
7M
increased by3.6%
Maintainers
1
Created
Weekly downloads
 

Package description

What is node-abi?

The node-abi package is designed to help developers determine the correct Node.js ABI (Application Binary Interface) version for a given version of Node.js or Electron. This is particularly useful for developers working with native modules, as it allows them to target and compile their modules against the correct ABI version, ensuring compatibility across different Node.js and Electron versions.

What are node-abi's main functionalities?

Determining Node.js ABI for a specific version

This feature allows developers to get the ABI version for a specific version of Node.js. It's useful for ensuring that native modules are compiled against the correct ABI version.

"const nodeAbi = require('node-abi');
const abi = nodeAbi.getAbi('14.0.0', 'node');
console.log(abi); // Outputs the ABI version for Node.js 14.0.0"

Determining Electron ABI for a specific version

Similar to the Node.js ABI determination, this feature allows for the retrieval of the ABI version for a specific version of Electron. It's essential for developers working with Electron applications that include native modules.

"const nodeAbi = require('node-abi');
const electronAbi = nodeAbi.getAbi('11.0.0', 'electron');
console.log(electronAbi); // Outputs the ABI version for Electron 11.0.0"

Getting all supported targets

This feature provides a list of all supported targets (Node.js and Electron versions) and their corresponding ABI versions. It's useful for developers to understand the range of versions their native module can support.

"const nodeAbi = require('node-abi');
const targets = nodeAbi.supportedTargets;
console.log(targets); // Outputs an array of supported targets including their versions and ABI"

Other packages similar to node-abi

Readme

Source

Node.js ABI

Build Status Auto-update ABI JSON file Snyk badge npm version

Get the Node ABI (application binary interface) for a given target and runtime, and vice versa.

Installation

npm install node-abi

Usage

const nodeAbi = require('node-abi')

nodeAbi.getAbi('7.2.0', 'node')
// '51'
nodeAbi.getAbi('1.4.10', 'electron')
// '50'
nodeAbi.getTarget('51', 'node')
// '7.2.0'
nodeAbi.getTarget('50', 'electron')
// '1.4.15'

nodeAbi.allTargets
// [
//  { runtime: 'node', target: '0.10.48', abi: '11', lts: false },
//  { runtime: 'node', target: '0.12.17', abi: '14', lts: false },
//  { runtime: 'node', target: '4.6.1', abi: '46', lts: true },
//  { runtime: 'node', target: '5.12.0', abi: '47', lts: false },
//  { runtime: 'node', target: '6.9.4', abi: '48', lts: true },
//  { runtime: 'node', target: '7.4.0', abi: '51', lts: false },
//  { runtime: 'electron', target: '1.0.2', abi: '47', lts: false },
//  { runtime: 'electron', target: '1.2.8', abi: '48', lts: false },
//  { runtime: 'electron', target: '1.3.13', abi: '49', lts: false },
//  { runtime: 'electron', target: '1.4.15', abi: '50', lts: false }
// ]
nodeAbi.deprecatedTargets
nodeAbi.supportedTargets
nodeAbi.additionalTargets
nodeAbi.futureTargets
// ...

References

Keywords

FAQs

Last updated on 23 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc