@trodi/electron-splashscreen
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

electron-splashscreen Build Status

Simple splashscreen for Electron applications.

Ideally, your application loads instantaneously. However, some applications are larger and/or may be running on a slower machine, causing the load to take longer. If the application is taking a bit to load, electron-splashscreen will appear so the user knows the application is loading, but can't interact with a partially loaded application.

electron-splashscreen is simple to incorporate, while allowing you the freedom to customize with any look, feel, and functionality.

No external dependencies.

Install

npm install @trodi/electron-splashscreen

Usage

Typescript Usage (javascript would be similar)

Example of your Electron browser process.

// import the module
import * as Splashscreen from "@trodi/electron-splashscreen";
const mainOpts: Electron.BrowserWindowConstructorOptions = ...
// configure the splashscreen
const config: Splashscreen.Config = {
    windowOpts: mainOpts;
    templateUrl: `${__dirname}/splash-screen.html`;
    splashScreenOpts: {
        width: 425,
        height: 325,
    },
};
// initialize the splashscreen handling
const main: BrowserWindow = Splashscreen.initSplashScreen(config);
// load your browser window per usual
main.loadURL(`file://index.html`);

You can run examples via npm run example and npm run example-dynamic.

API

API Documentation

Build

npm run build

Publish

  • npm version <patch|minor|major>
  • npm publish
  • Commit and push changes to git

License

MIT License

Package Sidebar

Install

npm i @trodi/electron-splashscreen

Weekly Downloads

428

Version

1.0.2

License

MIT

Unpacked Size

10.5 kB

Total Files

5

Last publish

Collaborators

  • trodi