Node.js is needed to "scaffold" an Electron project - the node package manage (npm) is used to download Electron packages, install dependencies and generate starter files.
Electron itself comes bundled with its own Node.js runtime.
This serves as the "back end" of your Electron app.
It manages windows, menus, system events and native OS integration. You can use Node modules directly in this environment e.g. fs, path and http.
The "renderer" process is Chromium.
By default, this can also access Node.js APIs unless explicitly disabled for security reasons. So you effectively have a "contained" web app with OS access.
The main process (Node.js runtime) communicates to the renderer via IPC.
This combined architecture of Node.js and Chromium enables applications to be written that run on Windows, macOS and Linux without experience of native UI development.
No comments:
Post a Comment