Synopsis
All of Node.js’s built-in modules are available in Electron and third-party node modules also fully supported as well (including the ).
Electron also provides some extra built-in modules for developing native desktop applications. Some modules are only available in the main process, some are only available in the renderer process (web page), and some can be used in either process type.
The main process script is like a normal Node.js script:
The renderer process is no different than a normal web page, except for the extra ability to use node modules if is enabled:
If you need the entire module, you can require it and then using destructuring to access the individual modules from .
This is equivalent to the following code: