electron-simple-ipc

1.0.2 • Public • Published

electron-simple-ipc

This standardises IPC in electron so it works the same in all threads. It will also JSON stringify/parse any objects send over IPC. This makes IPC much much faster.

Install

npm install electron-simple-ipc

Usage

Usage is the same in both the renderer/electron threads.

For example:

In electron:

const { ipcSend, ipcReceive } = require('electron-simple-ipc');
 
ipcSend('EVENT_FROM_ELECTRON', {
  data1: 'some data in the event payload'
})
 
ipcReceive('EVENT_FROM_RENDERER', (payload) => {
  console.log('We process the payload here', payload);
})
 

In Renderer:

const { ipcSend, ipcReceive } = require('electron-simple-ipc');
 
ipcSend('EVENT_FROM_RENDERER', {
  data1: 'some data in the event payload'
})
 
ipcReceive('EVENT_FROM_ELECTRON', (payload) => {
  console.log('We process the payload here', payload);
})
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    4
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i electron-simple-ipc

Weekly Downloads

4

Version

1.0.2

License

ISC

Last publish

Collaborators

  • mrblenny