electron-vars
Share data among different processes in Electron.
You can use it in main or renderer process.
Usage
npm install --save electron-vars // in main processconst vars = ; // in renderer processconst vars = remote;
vars; const value = vars; vars;
Share functions
You can share methods too, but be aware that the methods will run in the process they are defined. For example:
// in renderer process Avars;vars; // in main processvars; // in renderer process Bvars;
You will find that 'my method' is printed 3 times in the console window of process A.
Persist data
vars; const value = vars; const hasKey = vars; vars; varsclear;
Data will be stored in system default user config directory.