From 9c57d101f0181aa134190edb0b2e7aabdba1151f Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 20 Aug 2019 14:51:06 +0400 Subject: Added example application Signed-off-by: Valentin Popov --- example/application/src/utils/get-json.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 example/application/src/utils/get-json.js (limited to 'example/application/src/utils/get-json.js') diff --git a/example/application/src/utils/get-json.js b/example/application/src/utils/get-json.js new file mode 100644 index 0000000..18f4403 --- /dev/null +++ b/example/application/src/utils/get-json.js @@ -0,0 +1,12 @@ +import { app, ipcMain } from 'electron' +import jsonfile from 'jsonfile' +import path from 'path' + +ipcMain.on('get:json', async (event) => { + const tempDir = path.join(app.getAppPath(), 'temp') + + const main = await jsonfile.readFile(path.join(tempDir, 'main.json')) + const renderer = await jsonfile.readFile(path.join(tempDir, 'renderer.json')) + + event.sender.send('get:json:result', { main, renderer }) +}) -- cgit v1.2.3