In main process:
global.something = value;
In renderer process:
const remote = require('electron').remote; var something = remote.getGlobal('something');
To use same instance between main and renderer process, you can use global object from Node. To demonstrate this, let’s add logger to sample Todo application.
main.js we’re going to create logger instance which can be required and used in all other renderers.