Skip to main content
electron-builder can be used programmatically in your Node.js scripts to automate the build process.

Basic Example

Build Function

The main build() function accepts options and returns a Promise that resolves to an array of artifact paths.

Parameters

PackagerOptions & PublishOptions
required
Build and publish options combined.
Packager
Optional Packager instance. Created automatically if not provided.

Returns

Promise<Array<string>> - Resolves to an array of paths to built artifacts.

Platform Targets

Use the Platform class to create targets for specific platforms.

Creating Targets

The createTargets() helper function simplifies target creation.

Example

Complete Example

Using with TypeScript

Publishing

To publish artifacts programmatically:

See Also