Creating your desktop app can be easy with Electron. You can build cross-platform applications that work in any OS.
1. Have Node.js installed on your computer.
Building a Desktop App With Election
First, write the following in your terminal, replacing “
” with whatever name you like.
This command will generate the structure for our Electron app.
name of your project
In the src folder, you will find an
The file called
contains the setup of “
”. We have to make some changes to it.
This configuration allows Electron to work with
and with different modules.
Now you can copy your files to the
Remember that the main HTML file has to be named i
function will use that file to start the app.
You can also change the name of the starting file instead of “
”. Remember that you can replace the HTML and CSS file but do not change the
file. That file is the core of our application.
Now with your project ready to run, type “
You have to see a chromium window pop-up with your application running.
Before running the
command check that all is working.
If you want to make some adjustments to your app now is the time. Next, type “
” in your terminal.
npm run make
When this process has finished you will see a new folder called “out”.
Now your app is ready to install on your machine.
Go to the directory “
” and run the
And there you have it!
Click on your desktop window and access your brand new desktop app!
Congratulations, you’ve now built your quick and easy desktop app using Electron! How cool is that?
I hope you have found this article useful. Thanks for reading it.
Create your free account to unlock your custom reading experience.