Differences between revisions 8 and 10 (spanning 2 versions)
Revision 8 as of 2023-01-08 17:49:36
Size: 1473
Comment:
Revision 10 as of 2025-12-19 20:30:38
Size: 590
Comment: Cleanup
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()
  }
});
}}}
Line 69: Line 23:
== Usage == == Tool Chain ==

 * [[Node/ElectronBuilder|electron-builder]]
Line 72: Line 28:

=
== Utilities ===
== APIs ==
Line 85: Line 40:
=== Distribution ===

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

See also [[Node/ElectronBuilder|electron-builder]].


Electron

electron(1) is a framework for Node application.


Installation

Using npm(1):

npm install --save-dev electron


Tool Chain

APIs


CategoryRicottone

Node/Electron (last edited 2025-12-19 20:30:38 by DominicRicottone)