Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@electron/universal
Advanced tools
Utility for creating Universal macOS applications from two x64 and arm64 Electron applications
@electron/universal is an npm package designed to help developers create and manage universal builds of Electron applications. It allows you to combine multiple platform-specific builds (e.g., macOS, Windows, Linux) into a single package that can be distributed and run on different operating systems.
Combining Platform-Specific Builds
This feature allows you to combine x64 and arm64 builds of your Electron app into a single universal app. The code sample demonstrates how to use the `makeUniversalApp` function to specify the paths to the x64 and arm64 builds and the output path for the universal app.
const { makeUniversalApp } = require('@electron/universal');
makeUniversalApp({
x64AppPath: 'path/to/x64/app',
arm64AppPath: 'path/to/arm64/app',
outAppPath: 'path/to/universal/app'
}).then(() => {
console.log('Universal app created successfully!');
}).catch((err) => {
console.error('Error creating universal app:', err);
});
Extracting Platform-Specific Builds
This feature allows you to extract the x64 and arm64 builds from a universal app. The code sample demonstrates how to use the `extractFromUniversalApp` function to specify the path to the universal app and the output paths for the extracted x64 and arm64 builds.
const { extractFromUniversalApp } = require('@electron/universal');
extractFromUniversalApp({
universalAppPath: 'path/to/universal/app',
x64AppPath: 'path/to/extracted/x64/app',
arm64AppPath: 'path/to/extracted/arm64/app'
}).then(() => {
console.log('Platform-specific builds extracted successfully!');
}).catch((err) => {
console.error('Error extracting builds:', err);
});
electron-builder is a complete solution to package and build a ready-for-distribution Electron app for macOS, Windows, and Linux. It supports creating platform-specific builds and can be configured to handle various build tasks. Unlike @electron/universal, which focuses on creating universal builds, electron-builder provides a broader range of features for packaging and distributing Electron apps.
electron-packager is a command-line tool and Node.js library that bundles Electron-based application source code with a pre-built version of Electron, making it easy to create platform-specific builds. While it does not specifically focus on creating universal builds like @electron/universal, it is a popular tool for packaging Electron apps for different operating systems.
Create universal macOS Electron applications
import { makeUniversalApp } from '@electron/universal';
await makeUniversalApp({
x64AppPath: 'path/to/App_x64.app',
arm64AppPath: 'path/to/App_arm64.app',
outAppPath: 'path/to/App_universal.app',
});
Well, a Universal app isn't anything magical. It is literally the x64 app and the arm64 app glued together into a single application. It's twice as big because it contains two apps in one.
The way @electron/universal
works today means you don't need to worry about
things like building universal versions of your native modules. As long as
your x64 and arm64 apps work in isolation the Universal app will work as well.
Check out the Electron Apple silicon blog post
FAQs
Utility for creating Universal macOS applications from two x64 and arm64 Electron applications
The npm package @electron/universal receives a total of 272,979 weekly downloads. As such, @electron/universal popularity was classified as popular.
We found that @electron/universal 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.