electron-ipc-rpc-without-timeouts

1.0.2 • Public • Published

electron-ipc-rpc-without-timeouts

Allows communication between Electron's IPC-Main and IPC-Renderer processes with support for callbacks

Usage

main

const Rpc = require('electron-ipc-rpc');
const rpc = new Rpc(electron.ipcMain, mainWindow.webContents);
 
rpc.on('method2', (params, callback) => {
    callback(null, 'method2 response!');
});
 
rpc.send('method1', [], (err, res) => {
    console.log(res); 
});

renderer

const Rpc = require('electron-ipc-rpc');
const rpc = new Rpc(electron.ipcRenderer);
 
rpc.on('method1', (params, callback) => {
    callback(null, 'method1 response');
});
 
rpc.send('method2', [], (err, res) => {
    console.log(res); 
});

License

MIT © Daniel Nieto forked from Sebastian Raff

Package Sidebar

Install

npm i electron-ipc-rpc-without-timeouts

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

3.93 kB

Total Files

4

Last publish

Collaborators

  • danielnieto