What is Electron and its advantages over other JavaScript framework?

What is Electron and its advantages over other JavaScript framework?

June 3, 2022
3 min read
1187 views
0

Desktop applications always have a special place. The main idea behind developing desktop applications with JavaScript is that you build one codebase and package it for each operating system separately. This abstracts away the knowledge needed to build native desktop applications and makes maintenance easier. Nowadays, developing cross-platform applications with JavaScript relies on best frameworks - and one of is Electron.

Electron is a framework for creating desktop applications with all the emerging technologies including JavaScript, HTML, and CSS. It's an open-source framework developed and maintained by GitHub. It allows for the development of desktop GUI applications using web technologies - combines the Chromium rendering engine and the Node.js runtime.

Electron began in 2013 as the framework on which Atom, GitHub hackable text editor, would be built. Electron is the main GUI framework behind several notable open-source projects including Atom, GitHub Desktop, Light Table, Visual Studio Code, and Wordpress Desktop.

How does it work?

Electron applications are composed of multiple processes. There are the "browser" process and "renderer" processes, the browser process is where your core application logic and window management goes. This process can then launch multiple renderer processes which are the windows that actually appear on a user's screen rendering HTML and CSS.

 

  • Electron takes a main file defined in your package.json file and executes it. This main file creates application windows which contain rendered web pages and interaction with the native graphical user interface of your Operating System.

  • As of starting an application that uses Electron, the main process is created which is responsible for interacting with the native GUI of the Operating System. It creates the GUI of the application.

  • The application windows are created by the main process in the main file by using the BrowserWindow module.

  • Each browser window then runs its own renderer process.

  • The renderer process takes an HTML file which references the usual CSS files, JavaScript files, images, etc. and renders it in the window.

  • The main process can access the native GUI through modules available directly in Electron.

  • The desktop application can access all Node modules like the file system module for handling files, request to make HTTP calls, etc.

 

Electron offers a number of APIs that support the development of a desktop application in both the main process and the renderer process.

Advantages of Electron

  • Electron uses web technologies like simple HTML, CSS, and JavaScript.

  • It does not require native skills unless you want to do something advanced.

  • It can be designed for a single browser.

  • Its file system belongs to Node.js APIs and works on Linux, Mac OS X, Windows.

  • It uses npm module which is used widely for JavaScript.

  • It consists of a native menu for dialogs and notifications.

  • The windows installers do not need any configuration.

  • It also has the facility of auto-updating and crash reporting on Windows and Mac with Squirrel. The crash reports are submitted to the remote server for further analysis. The content tracing activities like debugging and profiling are looked after by Chromium.

  • Users won’t lose their data when they refresh.

  • Development cost for Electron applications is lower because developers don’t need to code across multiple browsers and operating systems.

Was this article helpful?Vote to let the author know
0
Share this article

Loading comments...

Related Articles

A Practical Guide To Building A Smooth Live Streaming Setup In Rockhampton, Queensland

A Practical Guide To Building A Smooth Live Streaming Setup In Rockhampton, Queensland

Rockhampton creators may work from a home office, a gaming room, a club space, or a temporary event location, so a setup should be easy to operate in the environment where it will actually be used. The best starting point is a stable, repeatable workflow that produces understandable audio, clear video, and dependable connection quality.

6 views
Read More
Read full article: A Practical Guide To Building A Smooth Live Streaming Setup In Rockhampton, Queensland
The Data Behind Planning a More Efficient Cross-Country Move

The Data Behind Planning a More Efficient Cross-Country Move

Digital tools and simple calculations can help you organize a long-distance move more efficiently. Rather than relying on rough estimates, you can use data to compare options, identify potential savings, and develop a realistic moving schedule.

7 views
Read More
Read full article: The Data Behind Planning a More Efficient Cross-Country Move
PST File Converter for IT Infrastructure Professionals Handling Cross-Platform Email Migration

PST File Converter for IT Infrastructure Professionals Handling Cross-Platform Email Migration

Discover how a PST File Converter helps IT administrators, system administrators, and enterprise professionals convert PST and OST files into multiple formats, including PDF, EML, MBOX, MSG, CSV, and JSON. Explore bulk conversion, cloud migration, duplicate email removal, date filtering, and folder hierarchy preservation with the SysInfo PST Converter Tool for efficient Outlook data management.

8 views
Read More
Read full article: PST File Converter for IT Infrastructure Professionals Handling Cross-Platform Email Migration