Chapter 2. Your first Electron application
This chapter covers
- Structuring and setting up an Electron application
- Generating a package.json, and configuring it to work with Electron in development
- Including a prebuilt version of Electron for your platform in your project
- Configuring your package.json to start up your main process
- Creating renderer processes from your main process
- Taking advantage of Electron’s relaxed sandboxing restrictions to build functionality that normally would not be possible inside of the browser
- Using Electron’s built-in modules to side-step some common issues
In chapter 1, we discussed what Electron is at a high level. That said, this book is called Electron in Action, right? In this chapter, we learn the ropes of Electron by setting up and building a simple application from the ground up to manage a list of bookmarks. The application will take advantage of features available only in the most modern browsers.
In that high-level discussion from the previous chapter, I mentioned that Electron is a runtime like Node. That’s still true, but I want to revisit that point for a moment. Electron is not a framework—it does not provide any scaffolding or have strong rules about how you structure your application or name your files. Those choices are left up to us, the developers. On the bright side, it also doesn’t enforce any conventions, and we have less conceptual boilerplate information to discuss before getting our hands dirty.