
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
axo-electron-rebuild
Advanced tools
Electron supporting package to rebuild native node modules against the currently installed electron
This executable rebuilds native io.js modules against the version of io.js that your Electron project is using. This allows you to use native io.js modules in Electron apps without your system version of io.js matching exactly (which is often not the case, and sometimes not even possible).
Install the package with --save-dev
:
npm install --save-dev electron-rebuild
Then, whenever you install a new npm package, rerun electron-rebuild:
./node_modules/.bin/electron-rebuild
Or if you're on Windows:
.\node_modules\.bin\electron-rebuild.cmd
electron-rebuild is also a library that you can just require into your app or build process. It has two main methods:
import { installNodeHeaders, rebuildNativeModules, shouldRebuildNativeModules } from 'electron-rebuild';
// Public: Determines whether we need to rebuild native modules (i.e. if they're
// already compiled for the right version of Electron, no need to rebuild them!)
//
// pathToElectronExecutable - Path to the electron executable that we'll use
// to determine NODE_MODULE_VERSION
// explicitNodeVersion (optional) - If given, use this instead of probing Electron
//
// Returns a Promise that if true, indicates you should build native modules
let shouldBuild = shouldRebuildNativeModules('/path/to/Electron');
// Public: Downloads and installs the header / lib files required to build
// native modules.
//
// nodeVersion - the version of Electron to download headers for
// nodeDistUrl (optional) - the URL to download the distribution from
// headersDir (optional) - where to put the headers
// arch (optional) - The architecture to build against (for building 32-bit apps
// on 64-bit Windows for example)
//
// Returns a Promise indicating whether the operation succeeded or not
let headerResult = installNodeHeaders('v0.25.0');
// Public: Rebuilds a node_modules directory with the given Electron version.
//
// nodeVersion - the version of Electron to download headers for
// nodeModulesPath - the path to a node_modules directory
// headersDir (optional) - where to find the headers
// Returns a Promise indicating whether the operation succeeded or not
headerResult.then(() => rebuildNativeModules('v0.25.0', './node_modules'));
A full build process might look something like:
shouldRebuildNativeModules(pathToElectron)
.then((shouldBuild) => {
if (!shouldBuild) return true;
return installNodeHeaders('v0.27.2')
.then(() => rebuildNativeModules('v0.27.2', './node_modules'));
})
.catch((e) => {
console.error("Building modules didn't work!");
console.error(e);
});
FAQs
Electron supporting package to rebuild native node modules against the currently installed electron
The npm package axo-electron-rebuild receives a total of 0 weekly downloads. As such, axo-electron-rebuild popularity was classified as not popular.
We found that axo-electron-rebuild demonstrated a not healthy version release cadence and project activity because the last version was released 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.