electron-ipc-broadcast

Broadcast IPC messages to all Electron processes.

Showing:

Popularity

Downloads/wk

3

GitHub Stars

10

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

Yes?

Categories

Readme

electron-ipc-broadcast

npm Build Status JavaScript standard style

Broadcast IPC messages to all Electron processes.

Install

npm i --save electron-ipc-broadcast

Example

In your main process, you need to first call this:

import { mainBroadcastListener } from 'electron-ipc-broadcast'
mainBroadcastListener()

Then you can use electron-ipc-broadcast anywhere within your app and listen to messages anywhere.

In any BrowserWindow process (renderer):

import broadcast from 'electron-ipc-broadcast'
broadcast('somemodule:somechannel', { message: 'hello' })

In any process (main or renderer) to listen to messages:

import { ipcRenderer } from '#electron'
ipcRenderer.on('somemodule:somechannel', (event, { payload }) => {
  const { message } = payload
  console.log(message) // => hello
})

License

MIT (c) JP Richardson 2016

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100