DEV Community

Cover image for What is Electron.js and Why You Should Use it?
Shariq Ahmed
Shariq Ahmed

Posted on

What is Electron.js and Why You Should Use it?

If you want to create complete cross-development software and apps for Windows, macOS, and Linux and you are already working on Node and JavaScript, then you should consider using Electron.js — a runtime framework built on top of Chromium and Node.js.

Electron.js was created as an open-source project by Chen Zhao — an engineer at GitHub. It was released on July 15, 2013. On 24–02–2024, version 29.0 was released.

Further, you can use anything including Vue, Angular, and React with electron.js.

But before starting it, you must have a bit of knowledge about JavaScript, HTML, and CSS. Moreover, you may not know this, but electron.js was used in the development of Discord, VS code, Asana, and Slack. You can see more examples here.

Moreover, as far as the structure of electron.js is concerned, it has three parts: Chromium, Node.js, and custom APIs. Through the Chromium environment, you can access all the APIs as well as development tools.

But Why Should You Use Electron.js?

Well, one of the advantages of using electron.js is that you can create cross-platform apps. This means that you can use the same JavaScript codebase to create apps on Windows, macOS, and Linux.

Apart from this, since you don’t need additional skills apart from the know-how of HTML, CSS, and JavaScript, electron.js is a bit easy to enter into.

And because of the fact that you need to use JavaScript code when it comes to creating an app made of electron.js, it’s relatively easy to debug and optimize. Developers don’t need to write everything from scratch.

Moreover, because of the autoUpdater component, the desktop apps made of electron.js are automatically updated in the background. A large community is also one plus point. You can post your questions on Stack Overflow or even dev.to if you are facing any problems. The best part is that the community of electron.js is also welcoming. Newbies are always welcomed with virtual open arms.

But then, there are also many cons of electron.js. For instance, since electron.js runs on Chromium, every electron app must have an individual or own Chromium version.

Just to write ‘ Hey, there. How are you?’, you’ll need a lot of space. In fact, a minimum of 80 MB of RAM is utilized by the electron apps. Some big apps will need GB. You can also expect electron apps to consume a minimum of 150 MB of storage.

Moreover, if the apps aren’t configured properly, then web pages inside Electron can get access to the entire system. Imagine how dangerous that would be if you were using third-party websites.

In short, electron.js isn’t for you if you don’t have enough RAM, hate slow apps, or loathe not seeing native UI/UX. Because this is all you’ll expect while working in electron.js.

Top comments (0)