Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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.
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"
Prebuild is a package that simplifies the process of building native modules across different Node.js versions. It automates the process of prebuilding binaries for multiple versions, which is a similar domain to node-abi but focuses more on the building process rather than just determining ABI versions.
NVM (Node Version Manager) is a tool for managing multiple Node.js versions. While not a direct alternative to node-abi, it relates in the sense that managing different Node.js versions is crucial for developers working with native modules and needing to ensure compatibility across versions.
Get the Node ABI for a given target and runtime, and vice versa.
npm install node-abi
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
// ...
FAQs
Get the Node ABI for a given target and runtime, and vice versa.
We found that node-abi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.