Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@electron/rebuild
Advanced tools
@electron/rebuild is a tool designed to help developers rebuild native Node.js modules against the current Electron version. This is particularly useful when working with native modules that need to be compatible with Electron's version of Node.js.
Rebuild Native Modules
This feature allows you to rebuild native Node.js modules to be compatible with a specific version of Electron. The code sample demonstrates how to use the `rebuild` function to rebuild modules in the current directory for Electron version 13.1.7.
const { rebuild } = require('@electron/rebuild');
rebuild({
buildPath: __dirname,
electronVersion: '13.1.7'
}).then(() => {
console.log('Rebuild complete!');
}).catch((err) => {
console.error('Rebuild failed:', err);
});
CLI Usage
You can also use @electron/rebuild from the command line to rebuild native modules. This command rebuilds the modules for Electron version 13.1.7.
npx electron-rebuild -v 13.1.7
Rebuild Specific Modules
This feature allows you to rebuild specific native modules rather than all modules in the project. The code sample demonstrates how to rebuild only the 'native-module' for Electron version 13.1.7.
const { rebuild } = require('@electron/rebuild');
rebuild({
buildPath: __dirname,
electronVersion: '13.1.7',
onlyModules: ['native-module']
}).then(() => {
console.log('Rebuild complete!');
}).catch((err) => {
console.error('Rebuild failed:', err);
});
electron-builder is a complete solution to package and build a ready-for-distribution Electron app. It includes support for rebuilding native modules, but also offers a wide range of other features such as auto-updates, code signing, and multi-platform builds. Compared to @electron/rebuild, electron-builder is more comprehensive but also more complex.
node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. While it can be used to rebuild native modules, it does not specifically target Electron and lacks the convenience features of @electron/rebuild. It requires more manual configuration and is generally used as a lower-level tool.
FAQs
Electron supporting package to rebuild native node modules against the currently installed electron
We found that @electron/rebuild 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
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.