Technology

Electron JS in 100 Seconds


Electrons build native desktop apps for platforms like Mac OS and Windows using nothing but HTML CSS and JavaScript it’s a tool behind many popular apps that you might be using today like the s code slack and discord just to name a few on the front end you build UIs just like

You would for a browser-based web app and you can bring along to our favorite frameworks but an electron you also have access to note J s and that means you can access low-level API s that you don’t normally have access to in a sandbox browser like the file system

Electron combines the front end and back end technologies and provides a bunch of other tools to work with native menus the system tray and so on let’s go ahead and build a desktop app now run NPM in it in an empty directory and install electron then create a

Main.js file and set that as the main entry point into your app every electron app has exactly one main process running it manages the lifecycle of your app and opens the windows that the end user will see each window is its own independent render process running with the chromium

Web browser when your main app is ready you can start a new render process by instantiating a browser window until the window to load a regular HTML file it will render the HTML CSS and JavaScript but do so in a native window and give you access to low-level api is to build

A true desktop experience create an index.html file and put whatever code you want inside of it but notice how i’m accessing note Global’s directly in my HTML that’s not something you can do in a normal web browser an electron gives you control over the operating system UI

As well for example add your own icon and controls to the system tray with just a few lines of code now after you build something awesome you can package it for multiple operating systems from a single codebase tools like electron packager or forage can handle the entire distribution process for you with a

Single command this has been electron in 100 seconds stay tuned for a full electron project in a few days and make sure to hit the like button if you want to see more short videos like this thanks for watching and I will see you in the next one

#Electron #Seconds
For More Interesting Article Visit : https://mycyberbase.com/

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *