Electron interprocess communication

There are two types of process in electron app

(1) Main process – is run by the main controller of the electron app and manege the lifecycle of the app

(2) Render process – represent the UI window and usually this is visible. This render process is managed by the Main process

There is only one main process for your electron app but you can have many render process for your app

Inter Process Communication (IPC) is used to communicate between main process and the render process

Each one of our browser window get separate render process.

If you want send data from render process to the main process you can use ipcRenderer You can send data in two ways (sync and async)

You can capture the data in main process using following code block and send reply back to the render process. You can use the ipcMain