Skip to content
BENIBIX Learn

Electron

Development🖥️ Platforms & OSDesktop Apps

Also known as Electron.js, ElectronJS

A tool for building desktop apps with web code. One app runs on Windows, macOS and Linux.

Think of it like

Think of it like a web page in its own picture frame. The page is the same, but it hangs on your own wall.

Example

Emma knows only web code. With Electron, she turns her to-do web page into a desktop app that her team installs.

Why it matters

Web coders can ship desktop apps and skip a new language. Many popular apps are built this way.

Definition

Electron is a free tool for building desktop apps with web code. You write the app in HTML, CSS and JavaScript. Electron packs it with a browser engine, Chromium, and with Node.js. The result runs on Windows, macOS and Linux. VS Code is built with it. The cost is size, since every app carries its own browser engine.

Example code

console
$ npm install --save-dev electron
$ npx electron .
Add Electron to a project, then open the app in its own window.
An Electron app is built once for each platform. Each build carries its own browser engine.

Common mistake

Expecting an Electron app to be small and light. Each one carries a whole browser engine, so it uses more memory.

Key takeaways

  1. 1
    Web code. HTML, CSS and JavaScript build the app.
  2. 2
    Browser inside. Chromium and Node.js ship in each app.
  3. 3
    Size is the cost. Big downloads and more memory.

Learn it properly