Differences between revisions 8 and 9
Revision 8 as of 2023-01-08 17:49:36
Size: 1473
Comment:
Revision 9 as of 2023-03-02 17:38:53
Size: 739
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:

----



== Example ==

A basic `election` application looks like:

{{{
const { app, BrowserWindow } = require("electron");
const path = require("path");

let win;
function init() {
  win = NewBrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      contextIsolation: true,
      nodeIntegration: false,
      preload: path.join(__dirname, "preload.js")
    }
  });

  win.loadFile(path.join(__dirname, "index.html"));

  win.on("closed", () => {
    win = null;
  });
}

app.on("ready", init);

app.on("window-all-closed", () => {
  if (process.platform !== "darwin") {
    app.quit();
  }
});

app.on("activate", () => {
  if (win === null) {
    init()
  }
});
}}}

Electron

electron(1) is a framework for Node application.


Installation

Using npm(1):

npm install --save-dev electron


Usage

Utilities

Distribution

TODO: copy from https://www.electronjs.org/docs/tutorial/application-distribution#manual-distribution.

See also electron-builder.


CategoryRicottone

Node/Electron (last edited 2023-03-02 17:38:53 by DominicRicottone)