LinuxCommandLibrary

electron

TLDR

Run Electron app

$ electron [.]
copy
Run specific directory
$ electron [path/to/app]
copy
Run with remote debugging
$ electron --remote-debugging-port=[9222] [.]
copy
Show version
$ electron --version
copy
Run with verbose logging
$ electron --enable-logging [.]
copy
Disable GPU acceleration
$ electron --disable-gpu [.]
copy

SYNOPSIS

electron [options] [path]

DESCRIPTION

Electron is a framework for building cross-platform desktop applications using web technologies (HTML, CSS, JavaScript). It embeds Chromium for rendering and Node.js for backend functionality.
Applications are packaged with their own Electron runtime, enabling deployment without system dependencies. Popular Electron apps include VS Code, Slack, Discord, and Atom.

PARAMETERS

path

Path to app directory or package.json.
--version
Show Electron version.
--remote-debugging-port port
Enable remote debugging.
--enable-logging
Enable logging to console.
--disable-gpu
Disable GPU hardware acceleration.
--no-sandbox
Disable sandbox (not recommended).
--inspect port
Enable Node.js inspector.
--inspect-brk port
Enable inspector and break on start.

PROJECT STRUCTURE

$ my-app/
├── package.json    # Main entry point defined
├── main.js         # Main process
├── preload.js      # Preload script
├── index.html      # Renderer content
└── renderer.js     # Renderer process
copy

CAVEATS

Large application size due to bundled Chromium. High memory usage. Security requires proper configuration (context isolation, preload scripts). Updates require careful handling. Multiple processes (main and renderer).

HISTORY

Electron was originally developed by GitHub as Atom Shell for the Atom editor in 2013. It was renamed to Electron in 2015 and released as open source. The project revolutionized desktop app development by enabling web developers to build native applications.

SEE ALSO

node(1), npm(1), nw(1)

Copied to clipboard