1.0.4 • Published 1 year ago
@potentii/electron-ipc-api v1.0.4
Electron IPC API
Create and consume electron IPC APIs
Index
Installing
$ npm install @potentii/electron-ipc-api
Examples
Main process
import { IpcApiMain } from '@potentii/electron-ipc-api';
const myUsersDatabase = //...
IpcApiMain.process('user-by-id', async data => {
const userFound = await myUsersDatabase.find({ id: data.id });
return userFound;
});
Renderer process
import { IpcApiRenderer } from '@potentii/electron-ipc-api';
const userFound = await IpcApiRenderer.send('user-by-id', { id: '1234' });