![]() ![]() But, hopefully now you have a solid fundamental understanding of how Electron works. Not too bad right? More functionality will come the more you learn about Node and Javascript in general. Inside index.js enter the following code: const ) ġ.2 If you have added a button with the id “mybutton” then the next time you run your node application and click that button, you should see a success.txt automatically be generated where you decided to save it. Create two new files called index.js and index.html NPM Install Electron by running npm install electron -save-dev *NOTE* we use -save-dev instead of -save so you can work on multiple apps with multiple electron version the future. Navigate to your project folder (you can just create a new folder wherever on your computer) and run the command npm init and follow the prompt provided Inspired by the getting started page and assuming you have performed step 0 of my previous guide. ![]() Part 1: Your first Electron App (AKA Hello World - again) If that sounded like a bunch of wumbo that’s okay but, it’s important to understand the Electron combines the browser and Node.js to create this seamless development experience for us. Which has plenty of use cases but, probably the biggest being is that your app can theoretically work without an internet connection. In short Electron launches a headless chromium browser which has access to the Node.js API via Electron’s own API. The question becomes, “How does Electron accomplish this?”. You can easily develop and distribute applications for windows/macOS/linux with the same code (bear in mind this does not include android or iOS). If you found this guide by wanting to develop cross platform applications then you probably know that Electron.js does just that. ![]()
0 Comments
Leave a Reply. |